Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
EduardZaydler committed Dec 10, 2024
1 parent 615e8e4 commit 6295cbe
Showing 1 changed file with 12 additions and 18 deletions.
30 changes: 12 additions & 18 deletions src/Components/TeamsList/TeamsList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,18 @@ import { Team } from "../../Domain/Team";

export const TeamsList: FC<{ teams?: Team[] }> = ({ teams }) => {
const [deletingTeam, setDeletingTeam] = useState<Team | null>(null);

if (!teams?.length) return <EmptyListText text={"There are no teams"} />;
return (
<>
{teams?.length ? (
<Grid gap="16px" columns="repeat(auto-fit, minmax(300px, 1fr))">
{teams?.map((team) => (
<TeamCard
key={team.id}
team={team}
isDeleting={deletingTeam?.id === team.id}
onOpenDelete={() => setDeletingTeam(team)}
onCloseDelete={() => setDeletingTeam(null)}
/>
))}
</Grid>
) : (
<EmptyListText text={"There are no teams"} />
)}
</>
<Grid gap="16px" columns="repeat(auto-fit, minmax(300px, 1fr))">
{teams?.map((team) => (
<TeamCard
key={team.id}
team={team}
isDeleting={deletingTeam?.id === team.id}
onOpenDelete={() => setDeletingTeam(team)}
onCloseDelete={() => setDeletingTeam(null)}
/>
))}
</Grid>
);
};

0 comments on commit 6295cbe

Please sign in to comment.