Files
gridpilot.gg/apps/website/components/leaderboards/LeaderboardTableShell.tsx
2026-01-18 23:24:30 +01:00

47 lines
1.0 KiB
TypeScript

import { Box } from '@/ui/Box';
import { Text } from '@/ui/Text';
import React from 'react';
interface LeaderboardTableShellProps {
children: React.ReactNode;
isEmpty?: boolean;
emptyMessage?: string;
emptyDescription?: string;
}
export function LeaderboardTableShell({
children,
isEmpty,
emptyMessage = 'No data found',
emptyDescription = 'Try adjusting your filters or search query',
}: LeaderboardTableShellProps) {
if (isEmpty) {
return (
<Box
py={16}
textAlign="center"
bg="bg-iron-gray/20"
border
borderColor="border-charcoal-outline"
rounded="xl"
>
<Text size="4xl" block mb={4}>🔍</Text>
<Text color="text-gray-400" block mb={2} weight="semibold">{emptyMessage}</Text>
<Text size="sm" color="text-gray-500">{emptyDescription}</Text>
</Box>
);
}
return (
<Box
rounded="xl"
bg="bg-iron-gray/20"
border
borderColor="border-charcoal-outline"
overflow="hidden"
>
{children}
</Box>
);
}