<template>
    <div>
        <div class="flex items-center justify-between">
            <h1 class="text-2xl font-bold text-neutral-900">{{ project?.name ?? '' }} — Groupes</h1>
        </div>

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

<script setup lang="ts">
import type { Project } from '~/services/dto/project'
import { useProjectService } from '~/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>
