Files
calendar/packages/emails/src/components/UserFieldsResponses.tsx
T
fabcf2055b feat: Ability to Hyperlink text in Checkbox on Additional Questions (#15194)
* feat: Ability to Hyperlink text in Checkbox on Additional Questions

* update

* fix and update

* fix type error

* fix and update

* dpdate

* fix type error

* fix unit test

* Update

* fix tests

* revert test

* remove yarn.lock

* remove schema.prisma

* update

* remove log

* revert

---------

Co-authored-by: Keith Williams <keithwillcode@gmail.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
Co-authored-by: Amit Sharma <74371312+Amit91848@users.noreply.github.com>
2024-09-05 09:05:45 +00:00

35 lines
1.0 KiB
TypeScript

import type { TFunction } from "next-i18next";
import getLabelValueMapFromResponses from "@calcom/lib/getLabelValueMapFromResponses";
import type { CalendarEvent } from "@calcom/types/Calendar";
import { Info } from "./Info";
export function UserFieldsResponses(props: { calEvent: CalendarEvent; t: TFunction; isOrganizer?: boolean }) {
const { t, isOrganizer = false } = props;
const labelValueMap = getLabelValueMapFromResponses(props.calEvent, isOrganizer);
if (!labelValueMap) return null;
return (
<>
{Object.keys(labelValueMap).map((key) =>
labelValueMap[key] !== "" ? (
<Info
key={key}
label={t(key)}
description={
typeof labelValueMap[key] === "boolean"
? labelValueMap[key]
? t("yes")
: t("no")
: `${labelValueMap[key] ? labelValueMap[key] : ""}`
}
withSpacer
isLabelHTML
/>
) : null
)}
</>
);
}