import { notFound } from 'next/navigation'; import { DocumentsPanel } from '@/app/(app)/equipe/[id]/DocumentsPanel'; import { InvitationPanel } from '@/app/(app)/equipe/[id]/InvitationPanel'; import { Badge } from '@/components/ui/Badge'; import { Card, CardHeader, EmptyState } from '@/components/ui/Card'; import { listDocuments } from '@/server/documents/queries'; import { getEmployee } from '@/server/employees/queries'; export const dynamic = 'force-dynamic'; export default async function DocumentsTab({ params, }: { params: Promise<{ id: string }>; }) { const { id } = await params; const employee = await getEmployee(id); if (!employee) notFound(); // `members.documents.view` peut manquer là où `members.view` est accordée : // la section disparaît alors, plutôt que d'échouer sur toute la page. const documents = await listDocuments(id).catch(() => null); return (