import type { RichCardImagePresentation } from '@linktr.ee/messaging-taxonomy' import type React from 'react' import type { BubbleGroupPosition } from '../MessageAttachment/types' export type { RichCardImagePresentation } /** * A single footer action button — the **presentational** half of a taxonomy * `RichCardAction`. The dispatching consumer resolves the action's `kind` to a * behaviour before handing it here: `open_external_url` → `href`; a `launch_*` * / `post_to_socials` kind → an `onClick` that opens its client surface. A kind * the consumer does not recognise is dropped (no button) rather than mapped, so * the card stands on its own image/title/subtitle — exactly the taxonomy's * unknown-kind rule. */ export interface RichCardActionButton { label: string /** Renders the button as an `` (for `open_external_url`). */ href?: string /** Called on activation (in addition to `href` navigation when both are set). */ onClick?: () => void /** * Button emphasis. The **first** action's variant drives the footer layout: * `primary` → a stacked full-width button below the copy; `secondary` → a row * in the chin with the copy on the left and the action pinned right. Defaults * to `primary`. */ variant?: 'primary' | 'secondary' } /** * Shared props for the `RichCard.*` variants (Sent, Received). The generic * rich message card: a `hero` or `fan` image region, a title + subtitle, and a * `variant`-driven footer of action buttons. The official welcome card and * broadcast link/collection cards are all this one card at different knobs. */ export interface RichCardBaseProps { title?: string /** Subtitle / body copy — the base attachment's `text`. */ subtitle?: string /** * Max lines the subtitle wraps before clamping. Defaults to `3` — rich cards * carry prose, unlike the single-line link-preview default. */ subtitleLines?: number /** SAFE public thumbnail URLs. `hero` shows the first; `fan` shows up to 3. */ images?: string[] /** * Image layout. Defaults from {@link images} length (≤1 → `hero`, ≥2 → * `fan`) via the taxonomy's `resolveRichCardImagePresentation`. */ imagePresentation?: RichCardImagePresentation /** * Footer actions. Empty / absent → no footer. Clients pass one today; the * shape is future-proof for several. */ actions?: RichCardActionButton[] /** Optional 16×16 brand badge rendered before the title. */ appIcon?: React.ReactNode /** * Dominant colour of the hero image (`#RRGGBB` or bare hex), painted as the * card + tail surface. Only applied for a single on-screen `hero` image (a * `fan` card keeps the plain fill) — the same gate LinkAttachment uses. */ accentColor?: string /** * Position of this card inside its same-author run. `'single'` / `'end'` * paint the accent-coloured bubble tail; `'first'` / `'middle'` omit it. * Defaults to `'single'`. */ groupPosition?: BubbleGroupPosition }