Files
2026FIFAWorldCup/platform/web/components/LiveMatchCenter.tsx
QuantBot aa7e3bba76
Some checks failed
2026 World Cup Quant Platform - Production Deployment / Code Quality & Testing (push) Failing after 1m49s
2026 World Cup Quant Platform - Production Deployment / Deploy to Production VM via Rsync (push) Has been skipped
chore: migrate deployment to Gitea Actions with zero-trust rsync
2026-06-16 19:06:50 +08:00

85 lines
2.4 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
'use client';
import {
Bar,
BarChart,
CartesianGrid,
ResponsiveContainer,
Tooltip,
XAxis,
YAxis,
} from 'recharts';
type XGPoint = {
minute: number;
xgHome: number;
xgAway: number;
};
type ZonePoint = {
zone: string;
pct: number;
};
type = {
timeline: {
minute: number;
label: string;
}[];
xgSeries: XGPoint[];
heatZones: ZonePoint[];
};
export function LiveMatchCenter({ timeline, xgSeries, heatZones }: ) {
return (
<section className="space-y-4">
<article className="panel-glow rounded-2xl p-4">
<h3 className="dot-matrix text-xl text-[#7d2a15]"></h3>
<ul className="mt-2 space-y-1 text-sm text-[#7a5b46]">
{timeline.map((item) => (
<li key={item.minute}>
{item.minute} {item.label}
</li>
))}
</ul>
</article>
<article className="panel-glow rounded-2xl p-4">
<h3 className="dot-matrix text-xl text-[#7d2a15]"></h3>
<div className="mt-2 h-72 w-full">
<ResponsiveContainer width="100%" height="100%">
<BarChart data={xgSeries}>
<CartesianGrid strokeDasharray="4 4" stroke="#eadcb9" />
<XAxis dataKey="minute" tick={{ fill: '#6d4d39' }} />
<YAxis tick={{ fill: '#6d4d39' }} />
<Tooltip
contentStyle={{ background: '#fff8e6', borderColor: '#d8b58c' }}
itemStyle={{ color: '#5f4031' }}
/>
<Bar dataKey="xgHome" fill="#b83822" name="主隊預期進球" />
<Bar dataKey="xgAway" fill="#7a4a2c" name="客隊預期進球" />
</BarChart>
</ResponsiveContainer>
</div>
</article>
<article className="panel-glow rounded-2xl p-4">
<h3 className="dot-matrix text-xl text-[#7d2a15]"></h3>
<div className="mt-3 space-y-2">
{heatZones.map((zone) => (
<div key={zone.zone}>
<p className="text-xs text-[#8a6b58]">{zone.zone}</p>
<div className="mt-1 h-3 overflow-hidden rounded-full bg-[#ece0ca]">
<div
className="h-full bg-[#b83822]"
style={{ width: `${Math.max(0, Math.min(zone.pct, 100))}%` }}
/>
</div>
</div>
))}
</div>
</article>
</section>
);
}