{"$schema":"https://ui.shadcn.com/schema/registry-item.json","name":"event-calendar-content","type":"registry:ui","title":"Active-view switchboard rendering month, week, day, N-days, or agenda; swappable per view via the components prop.","description":"Active-view switchboard rendering month, week, day, N-days, or agenda; swappable per view via the components prop.","dependencies":["radix-ui"],"registryDependencies":["@neui/event-calendar","@neui/event-calendar-agenda-view","@neui/event-calendar-month-view","@neui/event-calendar-resource-view","@neui/event-calendar-time-grid","@neui/event-calendar-types"],"files":[{"path":"event-calendar-content.tsx","type":"registry:ui","content":"// Title: Event Calendar Content\n// Description: Active-view switchboard rendering month, week, day, N-days, or agenda; swappable per view via the components prop.\n\n\"use client\"\n\nimport { type ComponentType, type HTMLAttributes, type ReactNode } from \"react\"\nimport {\n useEventCalendarSelector,\n useEventCalendarViewConfig,\n} from \"@/components/neui/event-calendar/event-calendar\"\nimport { EventCalendarAgendaView } from \"@/components/neui/event-calendar/event-calendar-agenda-view\"\nimport { EventCalendarMonthView } from \"@/components/neui/event-calendar/event-calendar-month-view\"\nimport { EventCalendarResourceView } from \"@/components/neui/event-calendar/event-calendar-resource-view\"\nimport {\n EventCalendarDaysView,\n EventCalendarDayView,\n EventCalendarWeekView,\n} from \"@/components/neui/event-calendar/event-calendar-time-grid\"\nimport type { CalendarView } from \"@/components/neui/event-calendar/event-calendar-types\"\nimport { Slot } from \"radix-ui\"\n\nimport { cn } from \"@/lib/utils\"\n\nconst DEFAULT_VIEW_COMPONENTS: Record = {\n month: EventCalendarMonthView,\n week: EventCalendarWeekView,\n day: EventCalendarDayView,\n days: EventCalendarDaysView,\n agenda: EventCalendarAgendaView,\n resource: EventCalendarResourceView,\n}\n\ninterface EventCalendarContentProps extends HTMLAttributes {\n /** Swap individual view implementations. */\n components?: Partial>\n /** Replaces the switchboard entirely; read useEventCalendarView() inside. */\n children?: ReactNode\n asChild?: boolean\n}\n\nfunction EventCalendarContent({\n className,\n asChild = false,\n components,\n children,\n ...props\n}: EventCalendarContentProps) {\n const viewConfig = useEventCalendarViewConfig()\n const view = useEventCalendarSelector((state) => state.view)\n const loading = useEventCalendarSelector((state) => state.loading)\n\n const resolved = {\n ...DEFAULT_VIEW_COMPONENTS,\n ...viewConfig.components,\n ...components,\n }\n // A spread copies keys that hold `undefined`, so `components={{ month: isPro\n // ? ProMonth : undefined }}` would erase the default and render .\n const ActiveView = resolved[view] ?? DEFAULT_VIEW_COMPONENTS[view]\n\n const Comp = asChild ? Slot.Root : \"div\"\n\n return (\n \n {children ?? }\n \n )\n}\n\nexport { DEFAULT_VIEW_COMPONENTS, EventCalendarContent }\nexport type { EventCalendarContentProps }","target":"components/neui/event-calendar/event-calendar-content.tsx"}]}