import { Linking, Text, TouchableOpacity, View } from "react-native"; import type { LocationStatus } from "@/lib/use-user-location"; const COPY: Record = { denied: { title: "Location access is off", body: "Waseel needs your location to show nearby drivers and set your pickup point.", action: "Open Settings", }, "services-off": { title: "Location services are off", body: "Turn on location on your device, then try again.", action: "Try Again", }, unavailable: { title: "Couldn't find your location", body: "Move somewhere with a clearer signal, or set your pickup point manually.", action: "Try Again", }, }; /** Fills the map slot when there's no position to draw. */ export const LocationNotice = ({ status, onRetry, }: { status: LocationStatus; onRetry: () => void; }) => { const copy = COPY[status]; if (!copy) return null; return ( {copy.title} {copy.body} status === "denied" ? void Linking.openSettings() : onRetry() } activeOpacity={0.8} className="mt-5 rounded-full bg-primary-500 px-6 py-3" > {copy.action} ); };