added rankings but ugly and tired

This commit is contained in:
2025-10-13 16:44:48 +02:00
parent 1139cfd5f0
commit 174e3e94ed
18 changed files with 721 additions and 51 deletions

View File

@@ -0,0 +1,25 @@
// components/MatchesSection.js
import React from 'react';
import { Box, Text } from 'ink';
function translateHomeAway(homeAway) {
if (homeAway === 'Home') return 'domicile';
if (homeAway === 'Away') return 'extérieur';
return homeAway;
}
export function MatchesSection({ matches, teamColor, teamName, width }) {
return (
<Box flexDirection="column" marginTop={1} width={width}>
<Text color={teamColor}>Matches à venir de <Text color={teamColor}>{teamName}</Text> :</Text>
{!matches && <Text>Chargement des matchs...</Text>}
{matches && matches.length === 0 && <Text>Aucun match trouvé.</Text>}
{matches && matches.slice(0, 2).map((m, i) => (
<Text key={i} wrap="truncate-end">
{m.date} {m.time} - <Text color={teamColor}>{teamName}</Text> vs {m.opponent} ({translateHomeAway(m.homeAway)})
</Text>
))}
</Box>
);
}