2026-03-02 13:18:47 -08:00
|
|
|
import { memo } from "react";
|
2025-10-25 18:25:26 -07:00
|
|
|
import { Badge } from "~/components/ui/badge";
|
|
|
|
|
|
|
|
|
|
interface SidebarRecentPicksProps {
|
|
|
|
|
picks: Array<{
|
|
|
|
|
id: string;
|
|
|
|
|
pickNumber: number;
|
|
|
|
|
round: number;
|
|
|
|
|
participant: {
|
|
|
|
|
name: string;
|
|
|
|
|
};
|
|
|
|
|
sport: {
|
|
|
|
|
name: string;
|
|
|
|
|
};
|
|
|
|
|
team: {
|
|
|
|
|
name: string;
|
|
|
|
|
};
|
|
|
|
|
}>;
|
|
|
|
|
}
|
|
|
|
|
|
2026-03-02 13:18:47 -08:00
|
|
|
export const SidebarRecentPicks = memo(function SidebarRecentPicks({ picks }: SidebarRecentPicksProps) {
|
2025-10-25 18:25:26 -07:00
|
|
|
return (
|
|
|
|
|
<div className="p-4">
|
|
|
|
|
{picks.length === 0 ? (
|
|
|
|
|
<p className="text-muted-foreground text-sm text-center py-8">
|
|
|
|
|
No picks yet...
|
|
|
|
|
</p>
|
|
|
|
|
) : (
|
|
|
|
|
<div className="space-y-1.5">
|
|
|
|
|
{picks
|
|
|
|
|
.slice()
|
2026-03-21 09:44:05 -07:00
|
|
|
.toReversed()
|
2025-10-25 18:25:26 -07:00
|
|
|
.map((pick) => (
|
|
|
|
|
<div
|
|
|
|
|
key={pick.id}
|
|
|
|
|
className="flex items-center justify-between p-2 bg-muted rounded-lg text-sm"
|
|
|
|
|
>
|
|
|
|
|
<div className="flex items-center gap-2 min-w-0 flex-1">
|
|
|
|
|
<Badge variant="outline" className="text-xs flex-shrink-0">
|
|
|
|
|
#{pick.pickNumber}
|
|
|
|
|
</Badge>
|
|
|
|
|
<div className="min-w-0 flex-1">
|
|
|
|
|
<p className="font-semibold truncate">{pick.participant.name}</p>
|
|
|
|
|
<p className="text-xs text-muted-foreground truncate">
|
|
|
|
|
{pick.sport.name}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div className="text-right flex-shrink-0 ml-2">
|
|
|
|
|
<p className="font-medium text-xs truncate max-w-[100px]">{pick.team.name}</p>
|
|
|
|
|
<p className="text-xs text-muted-foreground">
|
|
|
|
|
R{pick.round}
|
|
|
|
|
</p>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
))}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2026-03-02 13:18:47 -08:00
|
|
|
});
|