import { MapPin, Mountain } from 'lucide-react'; import React from 'react'; import { useTranslation } from '../../i18n/TranslationContext'; import { NEUTRAL_TINT, fs } from '../shared/DialogShell'; interface PlacesToursModeSwitchProps { active: boolean; onChange: (tours: boolean) => void; } /** * Switches the right add-panel between the ordinary Places sidebar and the * Tours selection list. Top level of the panel, mirroring RoadtripModeSwitch * (Days <-> Roadtrip), using the same placement and addon gating convention. * Only rendered while the tours addon is on. */ export default function PlacesToursModeSwitch({ active, onChange }: PlacesToursModeSwitchProps): React.ReactElement { const { t } = useTranslation(); const options: [boolean, string, typeof MapPin][] = [ [false, t('tours.mode.places'), MapPin], [true, t('tours.mode.tours'), Mountain], ]; return (
{options.map(([value, label, Icon]) => { const selected = active === value; return ( ); })}
); }