Files
gitlab-instance-0a899031_cn…/app/[locale]/report/page.tsx
2026-03-09 05:07:59 -05:00

86 lines
3.8 KiB
TypeScript

"use client";
import { useState } from "react";
import { Link, useTranslation } from "@/i18n/navigation";
import Footer from "@/app/components/Footer";
export default function ReportPage() {
const { t } = useTranslation("report");
const [generated, setGenerated] = useState(false);
return (
<div className="min-h-screen bg-[#fafafa] dark:bg-gray-950">
<div className="max-w-2xl mx-auto px-4 sm:px-6 py-12">
<div className="text-center mb-10">
<h1 className="text-2xl sm:text-3xl font-bold text-gray-900 dark:text-gray-100">
{t("title")}
</h1>
<p className="mt-2 text-gray-500 dark:text-gray-400">
{t("subtitle")}
</p>
<Link
href="/report/data"
className="inline-flex items-center gap-2 mt-4 px-4 py-2 rounded-xl border border-gray-200 dark:border-gray-700 text-sm font-medium text-gray-700 dark:text-gray-300 hover:bg-gray-50 dark:hover:bg-gray-800 transition-colors"
>
📊 {t("dataReport")}
</Link>
</div>
{!generated ? (
<div className="rounded-2xl bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 p-8 text-center">
<div className="w-20 h-20 mx-auto rounded-full bg-gradient-to-br from-amber-400 to-orange-500 flex items-center justify-center text-3xl mb-6">
📊
</div>
<p className="text-gray-600 dark:text-gray-400 mb-6">
{t("desc")}
</p>
<button
onClick={() => setGenerated(true)}
className="px-6 py-3 rounded-xl bg-[#ff4d4f] text-white font-medium hover:bg-[#ff3333] transition-colors"
>
{t("generate")}
</button>
</div>
) : (
<div className="rounded-2xl bg-white dark:bg-gray-900 border border-gray-200 dark:border-gray-700 overflow-hidden">
<div className="h-2 bg-gradient-to-r from-amber-400 via-orange-500 to-red-500" />
<div className="p-6 sm:p-8">
<h2 className="text-xl font-bold text-gray-900 dark:text-gray-100 mb-6">
{t("yearTitle")}
</h2>
<div className="grid grid-cols-2 gap-4 mb-6">
<div className="p-4 rounded-xl bg-gray-50 dark:bg-gray-800">
<p className="text-2xl font-bold text-[#ff4d4f]">8</p>
<p className="text-sm text-gray-500 dark:text-gray-400">{t("countries")}</p>
</div>
<div className="p-4 rounded-xl bg-gray-50 dark:bg-gray-800">
<p className="text-2xl font-bold text-[#ff4d4f]">¥5,200</p>
<p className="text-sm text-gray-500 dark:text-gray-400">{t("avgCost")}</p>
</div>
<div className="p-4 rounded-xl bg-gray-50 dark:bg-gray-800">
<p className="text-2xl font-bold text-[#ff4d4f]">12</p>
<p className="text-sm text-gray-500 dark:text-gray-400">{t("coworkingCheckins")}</p>
</div>
<div className="p-4 rounded-xl bg-gray-50 dark:bg-gray-800">
<p className="text-2xl font-bold text-[#ff4d4f]">3</p>
<p className="text-sm text-gray-500 dark:text-gray-400">{t("meetups")}</p>
</div>
</div>
<p className="text-xs text-gray-400 dark:text-gray-500 text-center">
{t("watermark")}
</p>
<button
onClick={() => setGenerated(false)}
className="mt-4 w-full py-2 rounded-lg border border-gray-200 dark:border-gray-700 text-sm text-gray-600 dark:text-gray-400 hover:bg-gray-50 dark:hover:bg-gray-800"
>
{t("regenerate")}
</button>
</div>
</div>
)}
</div>
<Footer />
</div>
);
}