Sort team names in favorites

This commit is contained in:
Daniel Schädler 2025-03-14 22:15:50 +01:00
parent 416a4fbc86
commit 05000a3243
1 changed files with 3 additions and 1 deletions

View File

@ -44,6 +44,8 @@ export function FavoriteBar({teams}) {
return <div>Loading...</div>;
}
const sortedTeams = [...teams].sort((a, b) => a.name.localeCompare(b.name));
return (
<div>
<div style={{display: 'flex', alignItems: 'center'}}>
@ -62,7 +64,7 @@ export function FavoriteBar({teams}) {
<div className="favorite-bar">
<h3>All Teams</h3>
<div>
{teams.map(team => (
{sortedTeams.map(team => (
<div key={team.id} style={{display: 'flex', alignItems: 'center'}}>
<Button onClick={() => toggleFavorite(team)} style={{marginRight: '10px'}}>
<FontAwesomeIcon