{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "comp-542",
  "type": "registry:component",
  "title": "Comp 542",
  "description": "Comp 542",
  "files": [
    {
      "path": "registry/ui-basic/comp-542.tsx",
      "content": "\"use client\";\r\n\r\nimport { useState } from \"react\";\r\n\r\nimport {\r\n\tEventCalendar,\r\n\ttype CalendarEvent,\r\n} from \"@/components/ui/event-calendar\";\r\nimport { addDays, setHours, setMinutes, subDays } from \"date-fns\";\r\n\r\n// Sample events data with hardcoded times\r\nconst sampleEvents: CalendarEvent[] = [\r\n\t{\r\n\t\tid: \"1\",\r\n\t\ttitle: \"Annual Planning\",\r\n\t\tdescription: \"Strategic planning for next year\",\r\n\t\tstart: subDays(new Date(), 24), // 24 days before today\r\n\t\tend: subDays(new Date(), 23), // 23 days before today\r\n\t\tallDay: true,\r\n\t\tcolor: \"sky\",\r\n\t\tlocation: \"Main Conference Hall\",\r\n\t},\r\n\t{\r\n\t\tid: \"2\",\r\n\t\ttitle: \"Project Deadline\",\r\n\t\tdescription: \"Submit final deliverables\",\r\n\t\tstart: setMinutes(setHours(subDays(new Date(), 9), 13), 0), // 1:00 PM, 9 days before\r\n\t\tend: setMinutes(setHours(subDays(new Date(), 9), 15), 30), // 3:30 PM, 9 days before\r\n\t\tcolor: \"amber\",\r\n\t\tlocation: \"Office\",\r\n\t},\r\n\t{\r\n\t\tid: \"3\",\r\n\t\ttitle: \"Quarterly Budget Review\",\r\n\t\tdescription: \"Strategic planning for next year\",\r\n\t\tstart: subDays(new Date(), 13), // 13 days before today\r\n\t\tend: subDays(new Date(), 13), // 13 days before today\r\n\t\tallDay: true,\r\n\t\tcolor: \"orange\",\r\n\t\tlocation: \"Main Conference Hall\",\r\n\t},\r\n\t{\r\n\t\tid: \"4\",\r\n\t\ttitle: \"Team Meeting\",\r\n\t\tdescription: \"Weekly team sync\",\r\n\t\tstart: setMinutes(setHours(new Date(), 10), 0), // 10:00 AM today\r\n\t\tend: setMinutes(setHours(new Date(), 11), 0), // 11:00 AM today\r\n\t\tcolor: \"sky\",\r\n\t\tlocation: \"Conference Room A\",\r\n\t},\r\n\t{\r\n\t\tid: \"5\",\r\n\t\ttitle: \"Lunch with Client\",\r\n\t\tdescription: \"Discuss new project requirements\",\r\n\t\tstart: setMinutes(setHours(addDays(new Date(), 1), 12), 0), // 12:00 PM, 1 day from now\r\n\t\tend: setMinutes(setHours(addDays(new Date(), 1), 13), 15), // 1:15 PM, 1 day from now\r\n\t\tcolor: \"emerald\",\r\n\t\tlocation: \"Downtown Cafe\",\r\n\t},\r\n\t{\r\n\t\tid: \"6\",\r\n\t\ttitle: \"Product Launch\",\r\n\t\tdescription: \"New product release\",\r\n\t\tstart: addDays(new Date(), 3), // 3 days from now\r\n\t\tend: addDays(new Date(), 6), // 6 days from now\r\n\t\tallDay: true,\r\n\t\tcolor: \"violet\",\r\n\t},\r\n\t{\r\n\t\tid: \"7\",\r\n\t\ttitle: \"Sales Conference\",\r\n\t\tdescription: \"Discuss about new clients\",\r\n\t\tstart: setMinutes(setHours(addDays(new Date(), 4), 14), 30), // 2:30 PM, 4 days from now\r\n\t\tend: setMinutes(setHours(addDays(new Date(), 5), 14), 45), // 2:45 PM, 5 days from now\r\n\t\tcolor: \"rose\",\r\n\t\tlocation: \"Downtown Cafe\",\r\n\t},\r\n\t{\r\n\t\tid: \"8\",\r\n\t\ttitle: \"Team Meeting\",\r\n\t\tdescription: \"Weekly team sync\",\r\n\t\tstart: setMinutes(setHours(addDays(new Date(), 5), 9), 0), // 9:00 AM, 5 days from now\r\n\t\tend: setMinutes(setHours(addDays(new Date(), 5), 10), 30), // 10:30 AM, 5 days from now\r\n\t\tcolor: \"orange\",\r\n\t\tlocation: \"Conference Room A\",\r\n\t},\r\n\t{\r\n\t\tid: \"9\",\r\n\t\ttitle: \"Review contracts\",\r\n\t\tdescription: \"Weekly team sync\",\r\n\t\tstart: setMinutes(setHours(addDays(new Date(), 5), 14), 0), // 2:00 PM, 5 days from now\r\n\t\tend: setMinutes(setHours(addDays(new Date(), 5), 15), 30), // 3:30 PM, 5 days from now\r\n\t\tcolor: \"sky\",\r\n\t\tlocation: \"Conference Room A\",\r\n\t},\r\n\t{\r\n\t\tid: \"10\",\r\n\t\ttitle: \"Team Meeting\",\r\n\t\tdescription: \"Weekly team sync\",\r\n\t\tstart: setMinutes(setHours(addDays(new Date(), 5), 9), 45), // 9:45 AM, 5 days from now\r\n\t\tend: setMinutes(setHours(addDays(new Date(), 5), 11), 0), // 11:00 AM, 5 days from now\r\n\t\tcolor: \"amber\",\r\n\t\tlocation: \"Conference Room A\",\r\n\t},\r\n\t{\r\n\t\tid: \"11\",\r\n\t\ttitle: \"Marketing Strategy Session\",\r\n\t\tdescription: \"Quarterly marketing planning\",\r\n\t\tstart: setMinutes(setHours(addDays(new Date(), 9), 10), 0), // 10:00 AM, 9 days from now\r\n\t\tend: setMinutes(setHours(addDays(new Date(), 9), 15), 30), // 3:30 PM, 9 days from now\r\n\t\tcolor: \"emerald\",\r\n\t\tlocation: \"Marketing Department\",\r\n\t},\r\n\t{\r\n\t\tid: \"12\",\r\n\t\ttitle: \"Annual Shareholders Meeting\",\r\n\t\tdescription: \"Presentation of yearly results\",\r\n\t\tstart: addDays(new Date(), 17), // 17 days from now\r\n\t\tend: addDays(new Date(), 17), // 17 days from now\r\n\t\tallDay: true,\r\n\t\tcolor: \"sky\",\r\n\t\tlocation: \"Grand Conference Center\",\r\n\t},\r\n\t{\r\n\t\tid: \"13\",\r\n\t\ttitle: \"Product Development Workshop\",\r\n\t\tdescription: \"Brainstorming for new features\",\r\n\t\tstart: setMinutes(setHours(addDays(new Date(), 26), 9), 0), // 9:00 AM, 26 days from now\r\n\t\tend: setMinutes(setHours(addDays(new Date(), 27), 17), 0), // 5:00 PM, 27 days from now\r\n\t\tcolor: \"rose\",\r\n\t\tlocation: \"Innovation Lab\",\r\n\t},\r\n];\r\n\r\nexport default function Component() {\r\n\tconst [events, setEvents] = useState<CalendarEvent[]>(sampleEvents);\r\n\r\n\tconst handleEventAdd = (event: CalendarEvent) => {\r\n\t\tsetEvents([...events, event]);\r\n\t};\r\n\r\n\tconst handleEventUpdate = (updatedEvent: CalendarEvent) => {\r\n\t\tsetEvents(\r\n\t\t\tevents.map((event) =>\r\n\t\t\t\tevent.id === updatedEvent.id ? updatedEvent : event\r\n\t\t\t)\r\n\t\t);\r\n\t};\r\n\r\n\tconst handleEventDelete = (eventId: string) => {\r\n\t\tsetEvents(events.filter((event) => event.id !== eventId));\r\n\t};\r\n\r\n\treturn (\r\n\t\t<EventCalendar\r\n\t\t\tevents={events}\r\n\t\t\tonEventAdd={handleEventAdd}\r\n\t\t\tonEventUpdate={handleEventUpdate}\r\n\t\t\tonEventDelete={handleEventDelete}\r\n\t\t/>\r\n\t);\r\n}\r\n",
      "type": "registry:ui"
    }
  ]
}