* 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>
20 lines
596 B
TypeScript
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
|
|
)}
|
|
</>
|
|
);
|
|
}
|