"use client"; import { useState } from "react"; import { useTranslation } from "@/i18n/navigation"; import Footer from "@/app/components/Footer"; const RATES = [ { from: "CNY", to: "USD", rate: 0.14 }, { from: "CNY", to: "EUR", rate: 0.13 }, { from: "CNY", to: "THB", rate: 5.2 }, { from: "USD", to: "CNY", rate: 7.2 }, ]; export default function ToolsPage() { const { t } = useTranslation("tools"); const [income, setIncome] = useState(100000); const [cnyAmount, setCnyAmount] = useState(10000); const [visaDate, setVisaDate] = useState("2025-06-15"); const taxEstimate = Math.round(income * 0.15); const cnyToUsd = (v: number) => (v * 0.14).toFixed(2); const daysLeft = Math.ceil( (new Date(visaDate).getTime() - Date.now()) / (1000 * 60 * 60 * 24) ); return (
{t("subtitle")}
{r.from} → {r.to}
{r.rate}
{t("disclaimer")}
{t("estimate")}: 约 ¥{taxEstimate.toLocaleString()}/年
{t("taxDisclaimer")}
{daysLeft > 0 ? `${daysLeft} ${t("daysLeft")}` : t("expired")}
{t("fireDesc")}
{t("climateDesc")}