From 0beadfa80b8d9285471adad7077e78fc8fa09971 Mon Sep 17 00:00:00 2001 From: Abhay Mishra Date: Sat, 7 Feb 2026 18:48:25 +0530 Subject: [PATCH] fix: allow deleting first time slot in availability schedule (#26448) (#27569) * fix: allow deleting first time slot in availability schedule (#26448) * code updated --------- Co-authored-by: Sahitya Chandra --- .../features/schedules/components/ScheduleComponent.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/features/schedules/components/ScheduleComponent.tsx b/packages/features/schedules/components/ScheduleComponent.tsx index d9e3fbf8f5..e395709768 100644 --- a/packages/features/schedules/components/ScheduleComponent.tsx +++ b/packages/features/schedules/components/ScheduleComponent.tsx @@ -129,13 +129,13 @@ export const ScheduleDay = ({ control={control} name={name} disabled={disabled} + copyButton={!disabled ? CopyButton : undefined} classNames={{ dayRanges: classNames?.dayRanges, timeRangeField: classNames?.timeRangeField, timePicker: classNames?.timePicker, }} /> - {!disabled &&
{CopyButton}
} )} @@ -242,6 +242,7 @@ export const DayRanges = ({ labels, userTimeFormat, classNames, + copyButton, }: { name: ArrayPath; control?: Control; @@ -249,6 +250,7 @@ export const DayRanges = ({ labels?: ScheduleLabelsType; userTimeFormat: number | null; classNames?: Pick; + copyButton?: React.ReactNode; }) => { const { t } = useLocale(); const { getValues } = useFormContext(); @@ -303,7 +305,8 @@ export const DayRanges = ({ }} /> )} - {index !== 0 && ( + {index === 0 && copyButton &&
{copyButton}
} + {fields.length > 1 && ( )}