import { Link } from '#/components/atoms/link.jsx'; import { cn } from '#/lib/utils.js'; /** * One row in a list: an optional leading `media` slot, a content column of * `title` and `description`, and a trailing `actions` slot. A navigational row * takes an `href` and renders as a real anchor; an action row takes `onClick` * and behaves as a button; without either it is static. `plain` drops the card * border for a flush list. */ export function ListRow({ media, title, description, actions, background, href, onNavigate, onClick, variant = 'card', className, }) { const interactive = href || typeof onClick === 'function'; const classes = cn( 'flex w-full items-center gap-4 text-left outline-none transition-colors', variant === 'card' ? 'rounded-2xl border border-border bg-card px-4 py-3' : 'px-1 py-3', // A background slot paints behind the content, clipped to the row and kept // below it: `isolate` scopes the stacking context so `-z-10` sits under the // row's own card background rather than the whole page. background && 'relative isolate overflow-hidden', interactive && 'cursor-pointer focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50', interactive && variant === 'card' && 'hover:border-input hover:bg-accent', interactive && variant === 'plain' && 'rounded-xl hover:bg-muted', className, ); const content = ( <> {background && (