import type { ReactNode } from 'react' import ToggleSwitch from '../Settings/ToggleSwitch' import { fs } from '../shared/DialogShell' /** * One addon in its type's card: a row like the bag sidebar's (#2541), with the * icon tile on the left, name and description beside it and the switch on the * right. Its sub-features sit under it in a grey inset box of hairline rows. * * The on/off state rides on the icon tile and the switch: a switched-off addon * greys its tile and its description, but keeps its name at full strength. The * name is the tile's identity, not its state; greying it out reads as "broken" * rather than "not enabled". * * The row 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}

{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}
)}
) }