Skip to content

Scheduling infrastructure for absolutely everyone.

dynamic link description on availability page (#4323)

Syed Ali Shahbaz1c46370572b5
diff --git a/apps/web/components/eventtype/EventTypeDescriptionSafeHTML.tsx b/apps/web/components/eventtype/EventTypeDescriptionSafeHTML.tsx
index d60a64019c3..0ce3f8636f5 100644
--- a/apps/web/components/eventtype/EventTypeDescriptionSafeHTML.tsx
+++ b/apps/web/components/eventtype/EventTypeDescriptionSafeHTML.tsx
@@ -1,11 +1,13 @@
export type EventTypeDescriptionSafeProps = {
- eventType: { description: string | null };
+ eventType: { description: string | null; isDynamic?: boolean };
};
export const EventTypeDescriptionSafeHTML = ({ eventType }: EventTypeDescriptionSafeProps) => {
const props: JSX.IntrinsicElements["div"] = { suppressHydrationWarning: true };
// @ts-expect-error: @see packages/prisma/middleware/eventTypeDescriptionParseAndSanitize.ts
if (eventType.description) props.dangerouslySetInnerHTML = { __html: eventType.descriptionAsSafeHTML };
+ // Dynamic link description is not set/pulled from the DB, hence we can allow it here as is
+ if (eventType.isDynamic) props.dangerouslySetInnerHTML = { __html: eventType.description || "" };
return <div {...props} />;
};