diff --git a/packages/atoms/availabilitylist/AvailabilityList.tsx b/packages/atoms/availabilitylist/AvailabilityList.tsx index 85f75bb85a..63d5d3393a 100644 --- a/packages/atoms/availabilitylist/AvailabilityList.tsx +++ b/packages/atoms/availabilitylist/AvailabilityList.tsx @@ -6,7 +6,7 @@ import { Clock } from "@calcom/ui/components/icon"; import { EmptyScreen } from "./EmptyScreen"; import { Availability } from "./ScheduleListItem"; -type Schedule = { +export type Schedule = { isDefault: boolean; id: number; name: string; @@ -14,13 +14,13 @@ type Schedule = { id: number; startTime: Date; endTime: Date; - userId: number | null; - eventTypeId: number | null; - date: Date | null; + userId?: number; + eventTypeId?: number; + date?: Date; days: number[]; - scheduleId: number | null; + scheduleId?: number; }[]; - timezone: string | null; + timezone?: string; }; export function AvailabilityList({ @@ -39,34 +39,34 @@ export function AvailabilityList({ duplicateMutation: ({ scheduleId }: { scheduleId: number }) => void; deleteMutation: ({ scheduleId }: { scheduleId: number }) => void; }) { + if (schedules.length === 0) { + return ( +
+ } + /> +
+ ); + } + return ( - <> - {schedules.length === 0 ? ( -
- } +
+
    + {schedules.map((schedule) => ( + -
- ) : ( -
-
    - {schedules.map((schedule) => ( - - ))} -
-
- )} - + ))} + +
); }