import * as React from 'react'; import { cn } from '@/lib/utils'; import { Avatar } from '@/components/ds/Avatar'; import { Surface } from '@/components/ds/Surface'; import { StatusBadge } from '@/components/ds/StatusBadge'; /** * ActivityCard — one event in a feed: who did what, when. * * Renders as a row by default (feeds are dense) and as a bordered card when * `variant="card"`. Either way the anatomy is fixed — actor, sentence, meta, * trailing slot — so a feed built from mixed event types stays aligned. */ export function ActivityCard({ /** Person or system that acted. */ actor, actorSrc, /** Icon shown instead of an avatar, for system events. */ icon: Icon, iconTone = 'soft', /** What happened — "Screened Sofia Mendez". */ title, /** Supporting detail. */ description, timestamp, status, /** Right-aligned slot — a score, a button. */ trailing, variant = 'row', onClick, className, }) { const iconTones = { soft: 'bg-krow-blue-tint text-krow-blue', brand: 'bg-krow-blue text-white', success: 'bg-success-muted text-success', warning: 'bg-warning-muted text-warning', destructive: 'bg-destructive-muted text-destructive', neutral: 'bg-surface-sunken text-ink-3', }; const body = ( <> {Icon ? ( ) : ( )}

{actor && {actor}} {actor && title && ' '} {title && {title}}

{description &&

{description}

} {timestamp &&

{timestamp}

}
{(status || trailing) && (
{status && } {trailing}
)} ); if (variant === 'card') { return ( {body} ); } const Comp = onClick ? 'button' : 'div'; return ( {body} ); }