import { notFound } from "next/navigation"; import { getProjectFullDetail, getRecentTimeEntries } from "@/lib/admin-queries"; import { getTargetHourlyRate } from "@/lib/settings"; import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"; import { PhasesTab } from "@/components/admin/tabs/PhasesTab"; import { PaymentsTab } from "@/components/admin/tabs/PaymentsTab"; import { DocumentsTab } from "@/components/admin/tabs/DocumentsTab"; import { CommentsTab } from "@/components/admin/tabs/CommentsTab"; import { TimerTab } from "@/components/admin/tabs/TimerTab"; import { OffersTab } from "@/components/admin/tabs/OffersTab"; import { PhasesViewToggle } from "@/components/admin/kanban/PhasesViewToggle"; import Link from "next/link"; export const revalidate = 0; export default async function ProjectDetailPage({ params, }: { params: Promise<{ id: string }>; }) { const { id } = await params; const [detail, targetHourlyRate] = await Promise.all([ getProjectFullDetail(id), getTargetHourlyRate(), ]); if (!detail) notFound(); const recentEntries = await getRecentTimeEntries(id, 5); const { project, phases, payments, documents, notes, comments, activeTimerEntryId, activeTimerStartedAt, totalTrackedSeconds, projectOffers, availableMicros, offersAcceptedTotal, transcripts, } = detail; return (
← Progetti

{project.name}

{project.client.name}

Fasi & Task Pagamenti Documenti Note Commenti Timer Offerte } phases={phases} clientId={id} />
{notes.length === 0 && (

Nessuna nota ancora.

)} {notes.map((note) => (

{note.body}

{new Date(note.created_at).toLocaleDateString("it-IT")}

))}
); }