manage team data

This commit is contained in:
yohlo
2025-09-22 17:24:45 -05:00
parent cae5fa1c71
commit ae934e77f4
7 changed files with 253 additions and 20 deletions

View File

@@ -39,14 +39,21 @@ const TeamListItem = React.memo(({ team }: TeamListItemProps) => {
interface TeamListProps {
teams: TeamInfo[];
loading?: boolean;
onTeamClick?: (teamId: string) => void;
}
const TeamList = ({ teams, loading = false }: TeamListProps) => {
const TeamList = ({ teams, loading = false, onTeamClick }: TeamListProps) => {
const navigate = useNavigate();
const handleClick = useCallback(
(teamId: string) => navigate({ to: `/teams/${teamId}` }),
[navigate]
(teamId: string) => {
if (onTeamClick) {
onTeamClick(teamId);
} else {
navigate({ to: `/teams/${teamId}` });
}
},
[navigate, onTeamClick]
);
if (loading)