import type { ReactNode } from 'react' import { Tooltip } from '../shared/Tooltip' import { MAP_CONTROL_SHADOW } from './mapControlShadow' /** * One round on/off control in the frosted shell every map control wears, so a new * one lines up with the compass, the layer switcher and the overview toggle. */ export function MapTogglePill({ active, onToggle, label, icon, testId, tooltipPlacement = 'left', badge = 0, opensDialog = false }: { active: boolean onToggle: () => void label: string icon: ReactNode testId?: string /** Away from the edge the control hugs: left on the right edge, right on the left one. */ tooltipPlacement?: 'left' | 'right' /** A count pinned to the top right corner while above zero (how many filters are on, say). */ badge?: number /** * The control opens a dialog instead of switching something on and off (the phone * map's places filter): it then announces the dialog, not a pressed state it * does not have. `active` still lights it. */ opensDialog?: boolean }) { return (