diff --git a/apps/web/modules/bookings/views/bookings-single-view.tsx b/apps/web/modules/bookings/views/bookings-single-view.tsx
index ca841004d7..7cb09d7929 100644
--- a/apps/web/modules/bookings/views/bookings-single-view.tsx
+++ b/apps/web/modules/bookings/views/bookings-single-view.tsx
@@ -296,7 +296,7 @@ export default function Success(props: PageProps) {
function getTitle(): string {
const titleSuffix = props.recurringBookings ? "_recurring" : "";
const titlePrefix = isRoundRobin ? "round_robin_" : "";
- if (isCancelled) {
+ if (isCancelled || isBookingInPast) {
return "";
}
if (needsConfirmation) {
@@ -340,6 +340,8 @@ export default function Success(props: PageProps) {
const providerName = guessEventLocationType(location)?.label;
const rescheduleProviderName = guessEventLocationType(rescheduleLocation)?.label;
+ const isBookingInPast = new Date(bookingInfo.endTime) < new Date();
+ const isReschedulable = !isCancelled && !isBookingInPast;
const bookingCancelledEventProps = {
booking: bookingInfo,
@@ -412,7 +414,7 @@ export default function Success(props: PageProps) {
imageSrc={`${bookingInfo.user.avatarUrl}`}
/>
)}
- {giphyImage && !needsConfirmation && !isCancelled && (
+ {giphyImage && !needsConfirmation && isReschedulable && (
// eslint-disable-next-line @next/next/no-img-element
)}
@@ -421,17 +423,19 @@ export default function Success(props: PageProps) {
"mx-auto flex h-12 w-12 items-center justify-center rounded-full",
isRoundRobin &&
"border-cal-bg dark:border-cal-bg-muted absolute bottom-0 right-0 z-10 h-12 w-12 border-8",
- !giphyImage && !isCancelled && !needsConfirmation ? "bg-success" : "",
- !giphyImage && !isCancelled && needsConfirmation ? "bg-subtle" : "",
- isCancelled ? "bg-error" : ""
+ !giphyImage && isReschedulable && !needsConfirmation ? "bg-success" : "",
+ !giphyImage && isReschedulable && needsConfirmation ? "bg-subtle" : "",
+ isCancelled || isBookingInPast ? "bg-error" : ""
)}>
- {!giphyImage && !needsConfirmation && !isCancelled && (
+ {!giphyImage && !needsConfirmation && isReschedulable && (