fix: time slot doesn't select in email embed (#19523)

Co-authored-by: Tushar Bhatt <95581504+TusharBhatt1@users.noreply.github.com>
This commit is contained in:
Anik Dhabal BabuandTushar Bhatt authored and GitHub committed 2025-02-26 21:13:17 +05:30
1 parent 78473bab1b
commit 3850b519fd
2 files changed
+6 -3

No files matched your search

@@ -55,7 +55,7 @@ type SlotItemProps = {
slot: Slot;
seatsPerTimeSlot?: number | null;
selectedSlots?: string[];
onTimeSelect: TOnTimeSelect;
onTimeSelect?: TOnTimeSelect;
onTentativeTimeSelect?: TOnTentativeTimeSelect;
showAvailableSeatsCount?: boolean | null;
event: {
@@ -201,6 +201,7 @@ const SlotItem = ({
StartIcon={layout === "column_view" ? "chevron-right" : undefined}
type="button"
onClick={() =>
onTimeSelect &&
onTimeSelect(slot.time, slot?.attendees || 0, seatsPerTimeSlot, slot.bookingUid)
}
data-testid="skip-confirm-book-button"
+4 -2
View File
@@ -14,6 +14,7 @@ import { AvailableTimes, AvailableTimesHeader } from "@calcom/features/bookings"
import { useBookerStore, useInitializeBookerStore } from "@calcom/features/bookings/Booker/store";
import { useEvent, useScheduleForEvent } from "@calcom/features/bookings/Booker/utils/event";
import DatePicker from "@calcom/features/calendars/DatePicker";
import type { Slot } from "@calcom/features/schedules";
import { useNonEmptyScheduleDays } from "@calcom/features/schedules";
import { useSlotsForDate } from "@calcom/features/schedules/lib/use-schedule/useSlotsForDate";
import { APP_NAME, DEFAULT_LIGHT_BRAND_COLOR, DEFAULT_DARK_BRAND_COLOR } from "@calcom/lib/constants";
@@ -286,7 +287,8 @@ const EmailEmbed = ({
});
const nonEmptyScheduleDays = useNonEmptyScheduleDays(schedule?.data?.slots);
const onTimeSelect = (time: string) => {
const handleSlotClick = (slot: Slot) => {
const { time } = slot;
if (!eventType) {
return null;
}
@@ -393,7 +395,7 @@ const EmailEmbed = ({
? selectedDatesAndTimes[eventType.slug][selectedDate as string]
: undefined
}
onTimeSelect={onTimeSelect}
handleSlotClick={handleSlotClick}
slots={slots}
showAvailableSeatsCount={eventType.seatsShowAvailabilityCount}
event={event}