"use client"; import { useMemo } from "react"; import { AreaChart, Area, XAxis, YAxis, ResponsiveContainer, Tooltip, } from "recharts"; import Panel from "./ui/Panel"; function generatePriceData() { const data = []; let price = 870; for (let i = 0; i < 60; i++) { price += (Math.random() - 0.47) * 8; data.push({ time: `${Math.floor(i / 4) + 9}:${String((i % 4) * 15).padStart(2, "0")}`, price: Math.round(price * 100) / 100, }); } return data; } const stats = [ { label: "Current Price", value: "$892.45", type: "up" as const }, { label: "Day Change", value: "+$27.83 (+3.21%)", type: "up" as const }, { label: "Volume", value: "48.2M", type: "neutral" as const }, { label: "RSI (14)", value: "67.4", type: "neutral" as const }, { label: "MACD Signal", value: "Bullish Cross", type: "up" as const }, { label: "50 SMA", value: "$842.10", type: "up" as const }, { label: "200 SMA", value: "$756.30", type: "up" as const }, { label: "ATR (14)", value: "$18.92", type: "neutral" as const }, { label: "Bollinger", value: "Upper Band", type: "down" as const }, ]; const typeColors = { up: "text-green border-l-green", down: "text-red border-l-red", neutral: "text-cyan border-l-cyan", }; export default function MarketOverview() { const data = useMemo(() => generatePriceData(), []); return (
`$${v.toFixed(0)}`} width={48} /> [`$${Number(value).toFixed(2)}`, "Price"]} />
{stats.map((s) => (
{s.label} {s.value}
))}
); }