'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' import { LunchRecapActions } from './lunch-recap-actions' export function LunchTab({ programId }: { programId: string }) { const { data: event, isLoading } = trpc.lunch.getEvent.useQuery({ programId }) const externalsRef = useRef(null) if (isLoading || !event) { return } return (
{event.enabled && ( <> externalsRef.current?.openEditDialog(id)} /> )}
) }