diff --git a/apps/what-today/src/components/experiences/DescriptionTextarea.tsx b/apps/what-today/src/components/experiences/DescriptionTextarea.tsx index 5ccb7d72..24b20f3c 100644 --- a/apps/what-today/src/components/experiences/DescriptionTextarea.tsx +++ b/apps/what-today/src/components/experiences/DescriptionTextarea.tsx @@ -8,7 +8,7 @@ function DescriptionTextarea({ error, ...props }: InputProps) { 설명 - + diff --git a/apps/what-today/src/components/experiences/RecurringScheduleModal.tsx b/apps/what-today/src/components/experiences/RecurringScheduleModal.tsx new file mode 100644 index 00000000..2f6181d5 --- /dev/null +++ b/apps/what-today/src/components/experiences/RecurringScheduleModal.tsx @@ -0,0 +1,255 @@ +import { Button, DatePicker, Popover, TimePicker, useToast } from '@what-today/design-system'; +import type { Dayjs } from 'dayjs'; +import { useState } from 'react'; + +interface Time { + hour: string; + minute: string; +} + +export interface Schedule { + date?: Dayjs | null; + startTime?: Time | null; + endTime?: Time | null; +} + +interface RecurringScheduleModalProps { + isOpen: boolean; + onOpenChange: (open: boolean) => void; + onSchedulesGenerated: (schedules: Schedule[]) => void; +} + +function timeToMinutes(time: { hour: string; minute: string } | null): number { + if (!time) return -1; + return parseInt(time.hour, 10) * 60 + parseInt(time.minute, 10); +} + +export default function RecurringScheduleModal({ + isOpen, + onOpenChange, + onSchedulesGenerated, +}: RecurringScheduleModalProps) { + const { toast } = useToast(); + const [selectedDays, setSelectedDays] = useState([]); + const [startTime, setStartTime] = useState