'use client' import { CalendarIcon } from 'lucide-react' import { useCallback, useEffect, useMemo, useState } from 'react' import { CalendarFeedDialog, type CalendarFeedSummary, type CreateCalendarFeedResult, } from '@/components/campaign/activity/CalendarFeedDialog' import { SetCampaignHeaderAction } from '@/components/campaign/shell/CampaignPageChromeContext' import { useCampaignQuickActionContext } from '@/components/campaign/shell/CampaignQuickActionContext' import { Button } from '@/components/ui/button' type AgendaFeedChromeProps = { feeds: CalendarFeedSummary[] onCreateFeed: (label: string) => Promise onRevokeFeed: (feedId: number) => Promise<{ ok: boolean }> } /** * Agenda page → app chrome bridge for the calendar-feed surface (C94, gate * unlocked by C93): registers the desktop header icon (agenda-contextual), * exposes the sheet to the mobile FAB quick action and owns the single shared * dialog instance. */ export const AgendaFeedChrome = ({ feeds, onCreateFeed, onRevokeFeed }: AgendaFeedChromeProps) => { const { setContext } = useCampaignQuickActionContext() const [open, setOpen] = useState(false) const openFeed = useCallback(() => setOpen(true), []) useEffect(() => { setContext((current) => ({ ...current, openCalendarFeed: openFeed })) return () => { setContext((current) => ({ ...current, openCalendarFeed: undefined })) } }, [setContext, openFeed]) const headerButton = useMemo( () => ( ), [openFeed], ) return ( <> {headerButton} ) }