import { useMemo } from "react"; import type { WcSimulationLineupPlayer } from "@/domain/entities"; import { placeStartersOnPitch } from "@/presentation/utils/pitchPlacement"; import { PitchField } from "./PitchField"; import { PlayerPitchToken } from "./PlayerPitchToken"; const LINE_COLOR: Record = { goleiro: "#fbbf24", defesa: "#00d4ff", meio: "#00ff88", ataque: "#f97316", }; interface LineupPitchViewProps { team: string; teamColor: string; formation: string | null; lineup: WcSimulationLineupPlayer[]; } export function LineupPitchView({ team, teamColor, formation, lineup }: LineupPitchViewProps) { const placed = useMemo( () => placeStartersOnPitch(lineup, formation), [lineup, formation], ); if (placed.length === 0) return null; const footer = formation ? (
Esquema {formation} · passe o mouse sobre o jogador para ver nota e cartões
) : null; return ( {placed.map((player, index) => (
))}
); }