import { createFileRoute, Link } from "@tanstack/react-router"; import { useCurrency } from "../hooks/useCurrency"; import { useUpdateSetting } from "../hooks/useSettings"; import { useWeightUnit } from "../hooks/useWeightUnit"; import type { Currency, WeightUnit } from "../lib/formatters"; const UNITS: WeightUnit[] = ["g", "oz", "lb", "kg"]; const CURRENCIES: { value: Currency; label: string }[] = [ { value: "USD", label: "$" }, { value: "EUR", label: "€" }, { value: "GBP", label: "£" }, { value: "JPY", label: "¥" }, { value: "CAD", label: "CA$" }, { value: "AUD", label: "A$" }, ]; export const Route = createFileRoute("/settings")({ component: SettingsPage, }); function SettingsPage() { const unit = useWeightUnit(); const currency = useCurrency(); const updateSetting = useUpdateSetting(); return (
Choose the unit used to display weights across the app
Changes the currency symbol displayed. This does not convert values.