Files
calendar/packages/emails/src/components/UserFieldsResponses.tsx
T
ce8e1d52da Fix "User Added Question" Label in Email and Calendar Invite (#7559)
* Show label in email and calendar invite and send label as well as name in webhook

* Make common code reusable

---------

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2023-03-07 17:50:54 +00:00

20 lines
596 B
TypeScript

import getLabelValueMapFromResponses from "@calcom/lib/getLabelValueMapFromResponses";
import type { CalendarEvent } from "@calcom/types/Calendar";
import { Info } from "./Info";
export function UserFieldsResponses(props: { calEvent: CalendarEvent }) {
const labelValueMap = getLabelValueMapFromResponses(props.calEvent);
if (!labelValueMap) return null;
return (
<>
{Object.keys(labelValueMap).map((key) =>
labelValueMap[key] !== "" ? (
<Info key={key} label={key} description={`${labelValueMap[key]}`} withSpacer />
) : null
)}
</>
);
}