"use client"; import { useState } from "react"; import Image from "next/image"; import { useApp } from "@/contexts/AppContext"; interface CalendarDayProps { day: number | null; value: string; type: "positive" | "negative" | "neutral" | "current"; } function CalendarDay({ day, value, type }: CalendarDayProps) { // Empty cell if (day === null) { return
; } const typeStyles = { positive: "bg-[#f2fcf7] dark:bg-green-900/20 border-[#cef3e0] dark:border-green-700/30", negative: "bg-[#fff8f7] dark:bg-red-900/20 border-[#ffdbd5] dark:border-red-700/30", neutral: "bg-[#f9fafb] dark:bg-gray-700 border-[#f3f4f6] dark:border-gray-600", current: "bg-[#111827] dark:bg-blue-600 border-[#111827] dark:border-blue-600", }; const isCurrent = type === "current"; const dayTextStyle = isCurrent ? "text-[#fcfcfd]" : "text-[#9ca1af] dark:text-gray-400"; const valueTextStyle = isCurrent ? "text-[#fcfcfd]" : "text-[#111827] dark:text-white"; return (
{day}
{value}
); } interface StatCardProps { label: string; value: string; } function StatCard({ label, value }: StatCardProps) { return (
{label} {value}
); } export default function PerformanceAnalysis() { const { t } = useApp(); const [currentMonth] = useState("November 2025"); // 模拟日历数据 - 5周数据 const weekData = [ [ { day: 31, value: "0.00%", type: "neutral" as const }, { day: 1, value: "+0.12%", type: "positive" as const }, { day: 2, value: "+0.08%", type: "positive" as const }, { day: 3, value: "-0.03%", type: "negative" as const }, { day: 4, value: "+0.15%", type: "positive" as const }, { day: 5, value: "+0.21%", type: "positive" as const }, { day: 6, value: "0.00%", type: "neutral" as const }, ], [ { day: 7, value: "+0.12%", type: "positive" as const }, { day: 8, value: "+0.12%", type: "positive" as const }, { day: 9, value: "-0.03%", type: "negative" as const }, { day: 10, value: "+0.08%", type: "positive" as const }, { day: 11, value: "-0.03%", type: "negative" as const }, { day: 12, value: "+0.21%", type: "positive" as const }, { day: 13, value: "0.00%", type: "neutral" as const }, ], [ { day: 14, value: "-0.03%", type: "negative" as const }, { day: 15, value: "-0.03%", type: "negative" as const }, { day: 16, value: "+0.15%", type: "positive" as const }, { day: 17, value: "+0.21%", type: "positive" as const }, { day: 18, value: "+0.08%", type: "positive" as const }, { day: 19, value: "0.00%", type: "neutral" as const }, { day: 20, value: "+0.12%", type: "positive" as const }, ], [ { day: 21, value: "+0.08%", type: "positive" as const }, { day: 22, value: "+0.15%", type: "positive" as const }, { day: 23, value: "-0.03%", type: "negative" as const }, { day: 24, value: "+0.12%", type: "current" as const }, { day: 25, value: "0.00%", type: "neutral" as const }, { day: 26, value: "+0.21%", type: "positive" as const }, { day: 27, value: "+0.08%", type: "positive" as const }, ], [ { day: 28, value: "+0.12%", type: "positive" as const }, { day: 30, value: "-0.03%", type: "negative" as const }, { day: 29, value: "-0.03%", type: "negative" as const }, { day: null, value: "", type: "neutral" as const }, { day: null, value: "", type: "neutral" as const }, { day: null, value: "", type: "neutral" as const }, { day: null, value: "", type: "neutral" as const }, ], ]; return (
{/* Top Section - Title and Stats */}

{t("performance.title")}

{t("performance.description")}

{/* Calendar Section */}
{/* Calendar Header */}

{t("performance.dailyNetReturns")}

{currentMonth}
{/* Calendar */}
{/* Weekday Headers */}
{["sun", "mon", "tue", "wed", "thu", "fri", "sat"].map((day) => (
{t(`performance.weekdays.${day}`)}
))}
{/* Calendar Grid */}
{weekData.map((week, weekIndex) => (
{week.map((day, dayIndex) => ( ))}
))}
); }