Scheduling infrastructure for absolutely everyone.
fix: show empty screen from event type availability tab (#26396)
Anik Dhabal Babuacee514c42cb
diff --git a/apps/web/modules/event-types/components/tabs/availability/EventAvailabilityTab.tsx b/apps/web/modules/event-types/components/tabs/availability/EventAvailabilityTab.tsxindex 2cf1b62c994..843d8912ada 100644--- a/apps/web/modules/event-types/components/tabs/availability/EventAvailabilityTab.tsx+++ b/apps/web/modules/event-types/components/tabs/availability/EventAvailabilityTab.tsx@@ -34,6 +34,7 @@ import { SettingsToggle } from "@calcom/ui/components/form";import { Icon } from "@calcom/ui/components/icon";import { Spinner } from "@calcom/ui/components/icon";import { SkeletonText } from "@calcom/ui/components/skeleton";+import { EmptyScreen } from "@calcom/ui/components/empty-screen";export type ScheduleQueryData = RouterOutputs["viewer"]["availability"]["schedule"]["get"];@@ -476,6 +477,20 @@ const EventTypeSchedule = ({return <SelectSkeletonLoader />;}+ if (schedulesQueryData.length === 0) {+ return (+ <EmptyScreen+ Icon="clock"+ headline={t("create_availability_schedule")}+ description={t("no_schedules_created_yet")}+ className="w-full"+ buttonRaw={<Button href="/availability" StartIcon="plus">+ {t("create")}+ </Button>}+ />+ );+ }+const options = schedulesQueryData.map((schedule) => ({value: schedule.id,label: schedule.name,diff --git a/apps/web/public/static/locales/en/common.json b/apps/web/public/static/locales/en/common.jsonindex 5824d4067b6..53d118a1a8a 100644--- a/apps/web/public/static/locales/en/common.json+++ b/apps/web/public/static/locales/en/common.json@@ -1298,6 +1298,8 @@"schedule_deleted_successfully": "Schedule deleted successfully","default_schedule_name": "Working Hours","new_schedule_heading": "Create an availability schedule",+ "no_schedules_created_yet": "You haven't created any availability schedules yet. Create one to get started.",+ "create_availability_schedule": "Create availability schedule","new_schedule_description": "Creating availability schedules allows you to manage availability across event types. They can be applied to one or more event types.","requires_ownership_of_a_token": "Requires ownership of a token belonging to the following address:","example_name": "John Doe",