import { type HTMLAttributes } from 'react';
import { type VariantProps } from 'class-variance-authority';
export { isSafeEntityUrl as isSafeMessageUrl } from '../_shared/is-safe-url';
export interface MessageSender {
/** Display name — drives the avatar's deterministic colour + initials. */
name: string;
/** Optional avatar image URL. */
avatarUrl?: string;
}
export interface MessageItem {
/** Unique identifier for the message (or thread). */
id: string;
/** Sender identity — avatar + bold display name. */
sender: MessageSender;
/** Optional subject / conversation title. Rendered bold when unread. */
subject?: string;
/** Last-message preview — rendered as plain text, clamped to two lines. */
preview: string;
/** ISO-8601 timestamp of when the message was sent. */
sentAt: string;
/** Whether the message has been seen. Unread items get accent styling. */
read?: boolean;
/** Optional deep link — when present the card row is an anchor. */
url?: string;
/**
* Count of unread messages inside a thread. Rendered as an end-aligned
* badge when greater than 1.
*/
unreadCount?: number;
}
export interface MessageCardProps extends Omit, 'onClick' | 'role' | 'title'>, VariantProps {
/** The message to render. */
item: MessageItem;
/**
* Layout shape.
* - `compact` — single-line row with the whole card clickable (used by
* MessageTray).
* - `dashboard` — bordered block with explicit CTA and mark-as-read
* controls (used by dashboards / sidebars).
*/
variant?: 'compact' | 'dashboard';
/**
* Fires when the read/unread status ball (the corner badge on the avatar) is
* activated. Supply to make the ball an interactive toggle; omit and it
* renders as a static read-state indicator.
*/
onToggleRead?: (item: MessageItem) => void;
/**
* Row chrome for the `compact` variant (ignored for `dashboard`). `'flat'`
* (default) — chrome-less row inside a bordered tray. `'elevated'` — own
* card chrome (border + `--shadow-sm`), matching `AppointmentCard` /
* `ClinicalNoteCard` for rail feeds (e.g. the Inbox).
*/
surface?: 'flat' | 'elevated';
/** Visual density. */
size?: 'sm' | 'md';
/** Fires when the row / title is activated. */
onActivate?: (item: MessageItem) => void;
/** Fires when the dismiss control is activated. */
onDismiss?: (item: MessageItem) => void;
/**
* Label for the dashboard-variant CTA. Only rendered when `variant` is
* `'dashboard'` and the item has a `url`.
*/
ctaLabel?: string;
/**
* Label for the dashboard-variant mark-as-read link. Only rendered when
* `variant` is `'dashboard'` and `onDismiss` is supplied.
*/
dismissLabel?: string;
/**
* External exit-animation control. When supplied the card plays its
* fade-out when this turns `true` and the consumer owns the subsequent
* unmount (see MessageTray). If omitted, the card self-manages the
* exit on internal dismiss.
*/
leaving?: boolean;
}
declare const cardVariants: (props?: ({
variant?: "compact" | "dashboard" | null | undefined;
size?: "sm" | "md" | null | undefined;
state?: "read" | "unread" | null | undefined;
surface?: "elevated" | "flat" | null | undefined;
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
export declare const MessageCard: import("react").ForwardRefExoticComponent>;
//# sourceMappingURL=message-card.d.ts.map