import type { ReactNode } from 'react' import styles from './ListRow.module.css' export type ListRowProps = { title: ReactNode meta?: ReactNode // Leading slot: icon, photo or avatar. leading?: ReactNode // Trailing slot: chevron, toggle, count or action. trailing?: ReactNode // When set, the leading slot, title and meta form one button. The trailing // slot stays a sibling outside it, so a trailing toggle or action is never // nested in the row's button and never triggers the row's action. onClick?: () => void className?: string } export function ListRow({ title, meta, leading, trailing, onClick, className }: ListRowProps) { const main = ( <> {leading && {leading}} {title} {meta && {meta}} > ) const trailingSlot = trailing && {trailing} if (onClick) { return (