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

62 lines
2.2 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.
type MatchConditionsCardProps = {
matchId: string;
strictnessIndex: number;
heatIndex: number;
cardsPressureAlert: boolean;
secondHalfHomeAttack: number;
secondHalfAwayAttack: number;
secondHalfUnderRecommendation: boolean;
attackerDirection: string;
};
export function MatchConditionsCard({
matchId,
strictnessIndex,
heatIndex,
cardsPressureAlert,
secondHalfHomeAttack,
secondHalfAwayAttack,
secondHalfUnderRecommendation,
attackerDirection,
}: MatchConditionsCardProps) {
const isHeatCritical = heatIndex >= 32;
const isStrict = strictnessIndex >= 80;
const underSignal = secondHalfUnderRecommendation || cardsPressureAlert;
return (
<article className="panel-glow rounded-2xl p-4">
<h3 className="dot-matrix text-lg text-[#7d2a15]">{matchId}</h3>
<div className="mt-3 space-y-2 text-sm text-[#6f4f3c]">
<p>{strictnessIndex.toFixed(1)}</p>
<p>Heat Index{heatIndex.toFixed(1)} </p>
<p>調{secondHalfHomeAttack.toFixed(2)}</p>
<p>調{secondHalfAwayAttack.toFixed(2)}</p>
<p>{attackerDirection}</p>
</div>
<div
className={`mt-4 rounded-xl border p-3 ${underSignal ? 'border-[#d1432d] bg-[#fff0e2]' : 'border-[#dcb53b] bg-[#fff8e6]'}`}
>
<p className="dot-matrix text-sm text-[#7d2a15]"></p>
{cardsPressureAlert ? (
<p className="mt-1 text-sm text-[#8c2f2f]">
</p>
) : null}
{isHeatCritical ? (
<p className="mt-1 text-sm text-[#8c2f2f]">
2H Under
</p>
) : null}
{isStrict ? (
<p className="mt-1 text-sm text-[#8c2f2f]"></p>
) : null}
{!cardsPressureAlert && !isHeatCritical ? (
<p className="mt-1 text-sm text-[#7a5b46]"></p>
) : null}
</div>
</article>
);
}