mirror of
https://github.com/Zproger/Aurum.git
synced 2026-10-13 02:56:39 +07:00
Aurum — a self-hosted personal finance operating system: cash flow, net worth tracking, budgets, goals, recurring payments, reports, proactive alerts, and a compound-interest returns calculator, all bilingual (RU/EN) and mobile-first. Ships as a three-container Docker Compose stack (Postgres + FastAPI + nginx-served React frontend). See README.md for setup and CONTRIBUTING.md for development.
35 lines
1.2 KiB
TypeScript
35 lines
1.2 KiB
TypeScript
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/Card";
|
|
import { Select } from "@/components/ui/Input";
|
|
import { useTranslation } from "@/lib/i18n";
|
|
import { CURRENCIES, getCurrencyLabel } from "@/lib/currency";
|
|
import { useAppSettings, useUpdateAppSettings } from "@/hooks/useSettings";
|
|
|
|
export function CurrencyCard() {
|
|
const { t, language } = useTranslation();
|
|
const { data: settings, isLoading } = useAppSettings();
|
|
const updateSettings = useUpdateAppSettings();
|
|
|
|
return (
|
|
<Card>
|
|
<CardHeader>
|
|
<CardTitle>{t("settings.currency")}</CardTitle>
|
|
</CardHeader>
|
|
<CardContent className="space-y-2">
|
|
<Select
|
|
value={settings?.currency ?? ""}
|
|
disabled={isLoading || updateSettings.isPending}
|
|
onChange={(event) => updateSettings.mutate({ currency: event.target.value })}
|
|
className="max-w-xs"
|
|
>
|
|
{CURRENCIES.map((currency) => (
|
|
<option key={currency.code} value={currency.code}>
|
|
{getCurrencyLabel(currency.code, language)}
|
|
</option>
|
|
))}
|
|
</Select>
|
|
<p className="text-xs text-text-muted">{t("settings.currencyHint")}</p>
|
|
</CardContent>
|
|
</Card>
|
|
);
|
|
}
|