import React from 'react' import { MapPin, ChevronDown } from 'lucide-react' import { trpc } from '../lib/trpc-client' import { useRegion } from '../contexts/RegionContext' import { useRegionSwitchContext } from '../hooks/useRegionSwitch' interface RegionBarProps { testID?: string /** Current vertical scroll offset — the bar collapses as it grows (matches native scrollY). */ scrollTop?: number } const BAR_HEIGHT = 34 export const RegionBar: React.FC = ({ testID = 'region-bar', scrollTop = 0 }) => { const { regionId, regionName } = useRegion() const { switchRegion } = useRegionSwitchContext() const { data: regionsData } = trpc.common.getRegions.useQuery(undefined, { staleTime: Infinity }) const regions = regionsData?.regions ?? [] const height = Math.max(0, BAR_HEIGHT - (scrollTop / 48) * BAR_HEIGHT) const opacity = Math.max(0, 1 - scrollTop / 32) return (
) } export default RegionBar