import { Navigation, LocateFixed, Locate } from 'lucide-react' import type { TrackingMode } from '../../hooks/useGeolocation' interface Props { mode: TrackingMode error: string | null onClick: () => void // Offset from the bottom edge — callers push this up above the mobile // bottom nav. Defaults to 20px for desktop. bottomOffset?: number } // Three-state FAB. Matches the Apple/Google Maps pattern: // off → outline locate icon // show → filled locate (blue dot is visible on the map) // follow → filled navigation arrow (map follows + rotates with heading) export default function LocationButton({ mode, error, onClick, bottomOffset = 20 }: Props) { const Icon = mode === 'follow' ? Navigation : mode === 'show' ? LocateFixed : Locate const isActive = mode !== 'off' const title = error ? error : mode === 'off' ? 'Show my location' : mode === 'show' ? 'Follow my location' : 'Stop following' return ( ) }