Files
2026FIFAWorldCup/platform/web/components/PropValueCard.tsx

45 lines
1.4 KiB
TypeScript
Raw 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';
type Props = {
playerName: string;
metricLabel: string;
line: number;
overProbability: number;
impliedProb: number;
edgePercent: number;
topEdge: boolean;
};
function percent(value: number): string {
return `${(value * 100).toFixed(1)}%`;
}
export function PropValueCard({
playerName,
metricLabel,
line,
overProbability,
impliedProb,
edgePercent,
topEdge,
}: Props) {
return (
<article className={`panel-glow rounded-2xl border p-4 ${topEdge ? 'prop-top-edge' : ''}`}>
<p className="dot-matrix text-sm text-[#7d2a15]">{playerName} · {metricLabel}</p>
<h4 className="mt-1 text-2xl font-semibold text-[#7d2a15]">{line.toFixed(1)} </h4>
<div className="mt-3 space-y-1 text-sm text-[#7a5b46]">
<p> Over {percent(overProbability)}</p>
<p>{percent(impliedProb)}</p>
<p>{edgePercent > 0 ? '+' : ''}{edgePercent.toFixed(1)}%</p>
</div>
{topEdge ? (
<p className="mt-3 rounded-lg bg-[#f5c6b4]/60 p-2 text-xs text-[#8a2e17] dot-matrix">
Top Edge
</p>
) : (
<p className="mt-3 text-xs text-[#6f4f3c]"></p>
)}
</article>
);
}