2026-04-29 02:40:32 +02:00
|
|
|
'use client'
|
|
|
|
|
|
|
|
|
|
import { trpc } from '@/lib/trpc/client'
|
|
|
|
|
import { Skeleton } from '@/components/ui/skeleton'
|
2026-04-29 02:41:34 +02:00
|
|
|
import { LunchEventConfig } from './lunch-event-config'
|
2026-04-29 02:42:07 +02:00
|
|
|
import { LunchDishes } from './lunch-dishes'
|
2026-04-29 02:42:49 +02:00
|
|
|
import { LunchManifest } from './lunch-manifest'
|
2026-04-29 02:40:32 +02:00
|
|
|
|
|
|
|
|
export function LunchTab({ programId }: { programId: string }) {
|
|
|
|
|
const { data: event, isLoading } = trpc.lunch.getEvent.useQuery({ programId })
|
|
|
|
|
if (isLoading || !event) {
|
|
|
|
|
return <Skeleton className="h-48 w-full" />
|
|
|
|
|
}
|
|
|
|
|
return (
|
|
|
|
|
<div className="space-y-6">
|
2026-04-29 02:41:34 +02:00
|
|
|
<LunchEventConfig programId={programId} event={event} />
|
2026-04-29 02:42:07 +02:00
|
|
|
{event.enabled && (
|
|
|
|
|
<>
|
|
|
|
|
<LunchDishes programId={programId} lunchEventId={event.id} />
|
2026-04-29 02:42:49 +02:00
|
|
|
<LunchManifest programId={programId} />
|
|
|
|
|
{/* Externals + recap actions mount in Tasks 17-18. */}
|
2026-04-29 02:42:07 +02:00
|
|
|
</>
|
|
|
|
|
)}
|
2026-04-29 02:40:32 +02:00
|
|
|
</div>
|
|
|
|
|
)
|
|
|
|
|
}
|