|
| 1 | +import Link from "next/link"; |
| 2 | +import { |
| 3 | + BrandedCard, |
| 4 | + PageHeader, |
| 5 | + StatusBadge, |
| 6 | +} from "@/components/app/app-primitives"; |
| 7 | +import { Button } from "@/components/ui/button"; |
| 8 | +import { getProjectStageLabel } from "@/lib/frontend-contracts"; |
| 9 | +import { buildWorkspaceProjectsPath } from "@/lib/routes"; |
| 10 | +import { requireProjectRouteContext } from "@/lib/server/auth"; |
| 11 | +import { formatTimestamp } from "@/lib/utils"; |
| 12 | + |
| 13 | +export default async function ProjectIntakePlaceholderPage({ |
| 14 | + params, |
| 15 | +}: { |
| 16 | + params: Promise<{ slug: string; projectSlug: string }>; |
| 17 | +}) { |
| 18 | + const { slug, projectSlug } = await params; |
| 19 | + const context = await requireProjectRouteContext({ |
| 20 | + workspaceSlug: slug, |
| 21 | + projectSlug, |
| 22 | + }); |
| 23 | + const project = context.project; |
| 24 | + |
| 25 | + return ( |
| 26 | + <div className="flex flex-col gap-6"> |
| 27 | + <PageHeader |
| 28 | + eyebrow="Project intake" |
| 29 | + title={project.name} |
| 30 | + description="The persistent intake wizard is the next phase. This protected route confirms the new project was created and routed correctly." |
| 31 | + action={ |
| 32 | + <Button |
| 33 | + render={<Link href={buildWorkspaceProjectsPath(context.routeWorkspace.slug)} />} |
| 34 | + variant="outline" |
| 35 | + > |
| 36 | + Back to projects |
| 37 | + </Button> |
| 38 | + } |
| 39 | + /> |
| 40 | + |
| 41 | + <BrandedCard className="grid gap-5 p-6 md:grid-cols-[1fr_18rem]"> |
| 42 | + <div className="space-y-4"> |
| 43 | + <StatusBadge> |
| 44 | + {getProjectStageLabel(project)} |
| 45 | + </StatusBadge> |
| 46 | + <div> |
| 47 | + <h2 className="text-lg font-semibold text-[color:var(--cpl-navy)]"> |
| 48 | + Intake route ready |
| 49 | + </h2> |
| 50 | + <p className="mt-2 max-w-2xl text-sm leading-6 text-muted-foreground"> |
| 51 | + This page is intentionally limited to route confirmation. Intake |
| 52 | + fields, autosave, delivery recommendations, procurement packages, |
| 53 | + approvals, and exports remain out of scope for Phase 2B. |
| 54 | + </p> |
| 55 | + </div> |
| 56 | + </div> |
| 57 | + |
| 58 | + <dl className="grid gap-3 rounded-lg border border-[color:var(--cpl-soft-border)] bg-muted/35 p-4 text-sm"> |
| 59 | + <div> |
| 60 | + <dt className="text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground"> |
| 61 | + Project ID |
| 62 | + </dt> |
| 63 | + <dd className="mt-1 font-medium text-[color:var(--cpl-navy)]"> |
| 64 | + {project.slug} |
| 65 | + </dd> |
| 66 | + </div> |
| 67 | + <div> |
| 68 | + <dt className="text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground"> |
| 69 | + Program |
| 70 | + </dt> |
| 71 | + <dd className="mt-1 text-muted-foreground"> |
| 72 | + {project.programDepartment ?? "Not assigned"} |
| 73 | + </dd> |
| 74 | + </div> |
| 75 | + <div> |
| 76 | + <dt className="text-xs font-semibold uppercase tracking-[0.14em] text-muted-foreground"> |
| 77 | + Updated |
| 78 | + </dt> |
| 79 | + <dd className="mt-1 text-muted-foreground"> |
| 80 | + {formatTimestamp(project.updatedAt)} |
| 81 | + </dd> |
| 82 | + </div> |
| 83 | + </dl> |
| 84 | + </BrandedCard> |
| 85 | + </div> |
| 86 | + ); |
| 87 | +} |
0 commit comments