// frontend/src/components/Schedule/ScheduleRow.tsx
import { CheckCircle, Pencil, Plus, Trophy } from 'lucide-react';
import React from 'react';
import { type MatchData } from '../../types';
import { printName, stringToColor } from '../../utils/helpers';
import WhistleIcon from "../../assets/whistle.svg?react"
interface ScheduleRowProps {
match: MatchData;
onMatchClick: (match: MatchData) => void;
badgeWidth: number;
}
export default function ScheduleRow({ match: m, onMatchClick, badgeWidth }: ScheduleRowProps) {
const courtColor = stringToColor(m.court);
const isFinished = m.isFinished;
const refName = m.ref_team?.name || m.ref_label;
return (
{m.time}
{m.court}
Match #{m.number}
{[{ n: m.p1, win: m.winnerName === m.p1, real: m.p1_is_real },
{ n: m.p2, win: m.winnerName === m.p2, real: m.p2_is_real }].map((p, i) => (
{p.win && }
{p.n}
{printName(p.n)}
{i === 0 && VS}
))}
{/* ACTION BUTTON AREA */}
{isFinished ? (
) : m.isReady && (
)}
{isFinished ? m.p1_sets : ''}
-
{isFinished ? m.p2_sets : ''}
{refName && !isFinished && (
{refName}
)}
);
}