import type { ReactNode } from 'react' import ToggleSwitch from '../Settings/ToggleSwitch' /** * One addon in the admin grid: a card whose fill carries the on/off state, with * an optional shelf at the foot holding its sub-features. * * The fill ladder is `--bg-secondary` (on) against `--bg-card` (the panel it * sits on) — that pair reads in both themes, because secondary is *darker* than * the card in light and *lighter* in dark. The obvious alternative, on = * `bg-surface-card`, inverts in dark and turns the disabled tiles into the loud * ones. * * Hover and focus ride on border and fill rather than a shadow: `--shadow-card` * is only declared in `:root`, so the `.dark` palette never overrides it and a * shadow-based affordance would be invisible there. * * The card is not a click target — only the switches are. No lift, no pointer * cursor, no `role="button"`. */ export default function AddonTile({ icon, name, description, enabled, onToggle, children, }: { icon: ReactNode name: string description?: string enabled: boolean onToggle: () => void /** The sub-shelf: `` children. */ children?: ReactNode }) { return (
{icon}
{/* The name stays full-strength when off: it is the tile's identity, not its state. Greying it out reads as "broken" rather than "not enabled". */}

{name}

{description}

{children && (
{/* Sitting inside the parent on its own fill is enough to say these belong to it — no rail, no indent guides. */}
    {children}
)}
) }