"use client" import { useContext } from "react" import { AuthUIContext } from "../../../lib/auth-ui-provider" import { cn } from "../../../lib/utils" import type { AuthLocalization } from "../../../localization/auth-localization" import { CardContent } from "../../ui/card" import type { SettingsCardClassNames } from "../shared/settings-card" import { SettingsCard } from "../shared/settings-card" import { SettingsCellSkeleton } from "../skeletons/settings-cell-skeleton" import { UserTeamCell } from "./user-team-cell" export interface UserTeamsCardProps { className?: string classNames?: SettingsCardClassNames localization?: Partial } export function UserTeamsCard({ className, classNames, localization }: UserTeamsCardProps) { const { hooks: { useListUserTeams }, localization: contextLocalization } = useContext(AuthUIContext) localization = { ...contextLocalization, ...localization } const { data: teams, isPending, refetch } = useListUserTeams() return ( {isPending ? ( ) : teams && teams.length > 0 ? ( teams .sort( (a, b) => new Date(a.createdAt).getTime() - new Date(b.createdAt).getTime() ) .map((team) => ( )) ) : (

{localization.NO_TEAMS_FOUND}

)}
) }