import type { ReactNode } from 'react'; export type SummaryCardVariant = 'source' | 'target'; export type SummaryCardStatusTone = 'success' | 'neutral' | 'warning' | 'error'; /** * Optional tooltip rendered around the status indicator. * Used to surface validation diagnostics (e.g. "why is the source not active?"). * The tooltip is only attached when at least `descriptionLabel` + `message` are present. */ export interface SummaryCardStatusTooltip { descriptionLabel: string; message: string; context?: string; remediationLabel?: string; remediation?: string; } export interface SummaryCardStatus { label: string; tone?: SummaryCardStatusTone; /** * Marker rendered before the label. `'loader'` turns the status line into a * progress indicator, for a card whose state is currently changing. * Defaults to `'dot'`. */ icon?: 'dot' | 'loader'; tooltip?: SummaryCardStatusTooltip; } export interface SummaryCardProps { variant: SummaryCardVariant; badge: string; icon: ReactNode; title: ReactNode; children: ReactNode; /** * When provided, renders a status indicator + label on the line below the title row. * Used for live state (e.g. Metrics “Active”) wherever the host passes it. */ status?: SummaryCardStatus; /** * Optional independent validation status rendered on a dedicated row below * the primary collector status and state. This keeps diagnostics, such as * CDC validation, separate from lifecycle. */ secondaryStatus?: SummaryCardStatus; /** * Rendered as-is on the primary status row, after `status`. Used for a * second, independent axis of state (e.g. a source's collector run state * next to its connectivity status). Shown even when `status` is absent. */ statusExtra?: ReactNode; /** * When true, renders a chevron in the header that toggles body visibility. * The consumer controls the state via `isCollapsed` / `onToggleCollapse`. */ collapsible?: boolean; isCollapsed?: boolean; onToggleCollapse?: () => void; collapseAriaLabel?: string; expandAriaLabel?: string; /** * Rendered as-is to the right of the header (after the chevron). * The consumer is responsible for providing a kebab `IconButton` + `Menu`. */ menu?: ReactNode; /** * Scopes assertions to one card. Both a source and a target card can be on * screen at once and they share row labels (e.g. "Port"), so tests need a way * to say "this card". */ 'data-testid'?: string; }