more imporvmentes

This commit is contained in:
yohlo
2025-10-11 00:33:27 -05:00
parent 6a7d119d3e
commit 127709bb6c

View File

@@ -22,12 +22,21 @@ const TeamListItem = React.memo(({ team }: TeamListItemProps) => {
[team.players]
);
const teamNameSize = useMemo(() => {
const nameLength = team.name.length;
if (nameLength > 20) return 'xs';
if (nameLength > 15) return 'sm';
return 'md';
}, [team.name]);
return (
<Group justify="space-between" w="100%">
<Text fw={500}>{`${team.name}`}</Text>
<Stack ml="auto" gap={0}>
{playerNames.map((name) => (
<Text size="xs" c="dimmed" ta="right">
<Group justify="space-between" w="100%" wrap="nowrap">
<Text fw={500} size={teamNameSize} style={{ flexShrink: 1, minWidth: 0, overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>
{`${team.name}`}
</Text>
<Stack ml="auto" gap={0} style={{ flexShrink: 0 }}>
{playerNames.map((name, idx) => (
<Text key={idx} size="xs" c="dimmed" ta="right">
{name}
</Text>
))}