diff --git a/docs/platform/guides/booking-redirects.mdx b/docs/platform/guides/booking-redirects.mdx index 9181eae9eb..e81d7f4b80 100644 --- a/docs/platform/guides/booking-redirects.mdx +++ b/docs/platform/guides/booking-redirects.mdx @@ -33,13 +33,13 @@ export default function Bookings(props: { calUsername: string; calEmail: string const { isLoading, data: booking, refetch } = useBooking((router.query.bookingUid as string) ?? ""); return ( - if (!Array.isArray(booking)) { -
{booking.title}
- } else { - {for (const recurrence of booking) { -{recurrence.title}
- }} - } + <> + {!Array.isArray(booking) ? ( +{booking.title}
+ ) : ( + booking.map((recurrence) =>{recurrence.title}
) + )} + > ) }; ``` @@ -96,33 +96,36 @@ const { mutate: cancelBooking } = useCancelBooking({ }, }); ... - return ( - if (!Array.isArray(booking)) { - - } else { - {for (const recurrence of booking) { - - }} - } - ) + return !Array.isArray(booking) ? ( + + ) : ( + <> + {booking.map((recurrence) => ( + + ))} + > + ); ``` An example implementation can be found [here](https://github.com/calcom/cal.com/blob/main/packages/platform/examples/base/src/pages/booking.tsx).