From 45c4f4789bb7442fb0014a1d458ebf3c387830c3 Mon Sep 17 00:00:00 2001 From: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com> Date: Wed, 29 Nov 2023 15:24:14 +0530 Subject: [PATCH] chore: add check for recording (#12584) Co-authored-by: Morgan <33722304+ThyMinimalDev@users.noreply.github.com> --- apps/web/components/booking/BookingListItem.tsx | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/apps/web/components/booking/BookingListItem.tsx b/apps/web/components/booking/BookingListItem.tsx index ea9efb0c746e0f..f2281abd8a7900 100644 --- a/apps/web/components/booking/BookingListItem.tsx +++ b/apps/web/components/booking/BookingListItem.tsx @@ -262,15 +262,21 @@ function BookingListItem(booking: BookingItemProps) { const title = booking.title; - const showRecordingsButtons = !!(booking.isRecorded && isPast && isConfirmed); + const showViewRecordingsButton = !!(booking.isRecorded && isPast && isConfirmed); + const showCheckRecordingButton = + isPast && + isConfirmed && + !booking.isRecorded && + (!booking.location || booking.location === "integrations:daily" || booking?.location?.trim() === ""); const showRecordingActions: ActionType[] = [ { id: "view_recordings", - label: t("view_recordings"), + label: showCheckRecordingButton ? t("check_for_recordings") : t("view_recordings"), onClick: () => { setViewRecordingsDialogIsOpen(true); }, + color: showCheckRecordingButton ? "secondary" : "primary", disabled: mutation.isLoading, }, ]; @@ -298,7 +304,7 @@ function BookingListItem(booking: BookingItemProps) { paymentCurrency={booking.payment[0].currency} /> )} - {showRecordingsButtons && ( + {(showViewRecordingsButton || showCheckRecordingButton) && ( ) : null} {isPast && isPending && !isConfirmed ? : null} - {showRecordingsButtons && } + {(showViewRecordingsButton || showCheckRecordingButton) && ( + + )} {isCancelled && booking.rescheduled && (