feat: external lunch attendees card + dialog

Adds program.listFinalistProjects helper. Externals dialog supports
both standalone and project-attached entries; manifest's external row
edit-pencil opens this dialog via forwardRef.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Matt
2026-04-29 02:44:38 +02:00
parent 051dea4d0e
commit bbfe2d8097
4 changed files with 372 additions and 3 deletions

View File

@@ -1,13 +1,16 @@
'use client'
import { useRef } from 'react'
import { trpc } from '@/lib/trpc/client'
import { Skeleton } from '@/components/ui/skeleton'
import { LunchEventConfig } from './lunch-event-config'
import { LunchDishes } from './lunch-dishes'
import { LunchManifest } from './lunch-manifest'
import { LunchExternals, type LunchExternalsHandle } from './lunch-externals'
export function LunchTab({ programId }: { programId: string }) {
const { data: event, isLoading } = trpc.lunch.getEvent.useQuery({ programId })
const externalsRef = useRef<LunchExternalsHandle>(null)
if (isLoading || !event) {
return <Skeleton className="h-48 w-full" />
}
@@ -17,8 +20,16 @@ export function LunchTab({ programId }: { programId: string }) {
{event.enabled && (
<>
<LunchDishes programId={programId} lunchEventId={event.id} />
<LunchManifest programId={programId} />
{/* Externals + recap actions mount in Tasks 17-18. */}
<LunchManifest
programId={programId}
onEditExternal={(id) => externalsRef.current?.openEditDialog(id)}
/>
<LunchExternals
ref={externalsRef}
programId={programId}
lunchEventId={event.id}
/>
{/* Recap actions card mounts in Task 18. */}
</>
)}
</div>