explorer-app/pages/project/[id]/index.vue

63 lines
1.3 KiB
Vue
Raw Normal View History

2023-12-19 18:43:42 +01:00
<script lang="ts" setup>
import type { Project } from '~/types'
definePageMeta({
layout: 'detail',
})
const route = useRoute()
const dataStore = useData()
const { getProjectById } = dataStore
const { projects } = storeToRefs(dataStore)
const project = ref<Project>()
await until(projects).toMatch(p => p?.length > 0)
project.value = getProjectById<Project>(route.params.id as string)
if (!project.value) {
throw createError({
statusCode: 404,
message: 'Project not found',
fatal: true,
})
}
2023-12-22 14:02:31 +01:00
useHead({
title: project.value.name,
})
useSeoMeta({
ogTitle: project.value.name,
ogDescription: project.value.description,
2023-12-22 14:07:51 +01:00
ogImage: project.value?.logos?.at(0)?.url ?? '',
2023-12-22 14:02:31 +01:00
})
2023-12-19 18:43:42 +01:00
</script>
<template>
<div v-if="project">
<div
app-container
px-16px
>
<div
flex
flex-col
gap-48px
mt-54px
>
2023-12-19 18:43:42 +01:00
<div>
<div>
<ProjectHeading :project="project" />
<ProjectOpeness :project="project" />
<ProjectTechnology :project="project" />
<ProjectPrivacy :project="project" />
<ProjectSecurity :project="project" />
2024-09-27 12:14:49 +02:00
<ProjectHistory
v-if="project.history"
:project="project"
/>
2023-12-19 18:43:42 +01:00
</div>
</div>
</div>
</div>
<Footer />
</div>
</template>