import { ReactNode } from '../../../node_modules/react'; import { ButtonProps } from '../Button'; import { IconName } from '../Icon'; export type ProfileCardAvatarVariant = 'circular' | 'rounded' | 'square'; /** Picks banner artwork and the shape of every avatar on the card. */ export type ProfileCardVariant = 'customer' | 'user'; /** * Image only — the shape is derived from the card `variant`, so every avatar on * a card (trigger, header, section rows) stays consistent. */ export interface ProfileCardAvatar { /** Image URL. Falls back to initials derived from the title (or item label). */ src?: string; alt?: string; } export interface ProfileCardBanner { /** Decorative banner image URL. */ image?: string; /** CSS background used when there is no image (color or gradient). */ background?: string; /** @default 51 */ height?: number; } export interface ProfileCardActionButton { label: string; onClick?: () => void; /** @default 'outlined' */ variant?: ButtonProps['variant']; /** @default 'inherit' */ color?: ButtonProps['color']; disabled?: boolean; /** Hides this button without removing it from `data`. */ hidden?: boolean; } export interface ProfileCardIconAction { id?: string; icon: IconName; /** Accessible label, also used as the tooltip. */ label: string; /** Icon color — theme path (`'success.main'`) or CSS color. */ color?: string; onClick?: () => void; disabled?: boolean; hidden?: boolean; } export interface ProfileCardDetail { id?: string; label: string; value: ReactNode; /** Optional icon shown before the label. */ icon?: IconName; hidden?: boolean; } export interface ProfileCardListItem { id?: string; label: string; secondary?: string; /** * Avatar image. Initials and colors come from `label`, the shape from the * card `variant`. Set to `false` to hide the avatar for this row. */ avatar?: ProfileCardAvatar | false; onClick?: () => void; hidden?: boolean; } export interface ProfileCardSection { id?: string; /** Section heading, e.g. `"Campaigns(3):"`. */ title?: string; items?: ProfileCardListItem[]; /** Custom section body rendered instead of `items`. */ content?: ReactNode; /** Caps how many items render; the rest are summarised as `+N more`. */ maxItems?: number; hidden?: boolean; } /** * Data the parent passes in; ProfileCard renders all of it. Purely content — * the card kind lives on the `variant` prop, so a payload can come straight * from an API without carrying presentation choices. */ export interface ProfileCardData { /** Display name. Also seeds avatar initials (`getInitials`) and colors (`getAvatarColors`). */ title?: string; subtitle?: ReactNode; /** Optional image. Initials and colors are derived from `title`. */ avatar?: ProfileCardAvatar; banner?: ProfileCardBanner; /** Primary action rendered next to the title, e.g. `View CRM`. */ action?: ProfileCardActionButton; /** Row of icon buttons below the title, e.g. call / WhatsApp / email. */ iconActions?: ProfileCardIconAction[]; /** Label–value rows. */ details?: ProfileCardDetail[]; /** Grouped blocks rendered after the details. */ sections?: ProfileCardSection[]; footer?: ReactNode; }