import { classNames } from "@calcom/lib"; import { useCopy } from "@calcom/lib/hooks/useCopy"; import type { BadgeProps } from "@calcom/ui"; import { Badge, Button, Label } from "@calcom/ui"; import { ClipboardCheck, Clipboard } from "@calcom/ui/components/icon"; type DisplayInfoType = { label: string; value: T extends true ? string[] : string; asBadge?: boolean; isArray?: T; displayCopy?: boolean; badgeColor?: BadgeProps["variant"]; } & (T extends false ? { displayCopy?: boolean; displayCount?: never } : { displayCopy?: never; displayCount?: number }); // Only show displayCopy if its not an array is false export function DisplayInfo({ label, value, asBadge, isArray, displayCopy, displayCount, badgeColor, }: DisplayInfoType) { const { copyToClipboard, isCopied } = useCopy(); const values = (isArray ? value : [value]) as string[]; return (
<> {values.map((v) => { const content = ( {v} {displayCopy && (
); }