import { Computer, Moon, Sun, Trash2 } from "lucide-react"; import { useState } from "react"; import { useTranslation } from "react-i18next"; import { Link } from "react-router"; import { PushNotificationSettings } from "~/components/PushNotificationSettings"; import { usePageTitle } from "~/contexts/PageTitleContext"; import { useApp, type Theme } from "../AppContext"; import "../tailwind-full.css"; export default function Settings() { const { t, i18n } = useTranslation(); usePageTitle(t("navbar.settings", "Ajustes")); const [showClearConfirm, setShowClearConfirm] = useState(false); const [cleared, setCleared] = useState(false); const { theme, setTheme, mapPositionMode, setMapPositionMode, showTraffic, setShowTraffic, showCameras, setShowCameras, showBusStops, setShowBusStops, showCoachStops, setShowCoachStops, showTrainStops, setShowTrainStops, } = useApp(); const THEMES = [ { value: "light" as Theme, label: t("about.theme_light", "Claro"), icon: Sun, }, { value: "dark" as Theme, label: t("about.theme_dark", "Oscuro"), icon: Moon, }, { value: "system" as Theme, label: t("about.theme_system", "Sistema"), icon: Computer, }, ]; return (
{/* Theme Selection */}

{t("about.theme", "Tema")}

{THEMES.map(({ value, label, icon: Icon }) => ( ))}
{/* Map Position Mode */}
{/* Map Layers */}

{t("about.map_layers", "Capas del mapa")}


{/* Language Selection */}
{" "}
{/* Push Notifications */}
{/* Privacy / Clear data */}

{t("settings.privacy_title", "Privacidad y datos")}

{!showClearConfirm && !cleared && ( )} {showClearConfirm && (

{t( "settings.clear_data_confirm", "Se eliminarán tus paradas favoritas, nombres personalizados, paradas recientes, historial de rutas, lugares guardados y posición del mapa. Las preferencias de ajustes se conservarán." )}

)} {cleared && (

{t( "settings.clear_data_done", "Tus datos se han borrado correctamente." )}

)}

{t("settings.privacy_policy_link", "Política de privacidad")}

); }