<template>
    <div>
        <PageHeader>{{ project?.name ?? '' }} — Groupes</PageHeader>

        <div>
            <ProjectGroupTab :project-id="projectId" />
        </div>
    </div>
</template>

<script setup lang="ts">
import type { Project } from '~/modules/project-management/services/dto/project'
import { useProjectService } from '~/modules/project-management/services/projects'

const route = useRoute()
const projectId = computed(() => Number(route.params.id))

useHead({ title: 'Groupes du projet' })

const projectService = useProjectService()
const project = ref<Project | null>(null)

async function loadProject() {
    project.value = await projectService.getById(projectId.value)
}

onMounted(() => {
    loadProject()
})
</script>
