- types, DataListSkeleton, DataListEmpty, DataListError, DataList - Remove duplicate Modal/Dropdown from DataList.tsx (exist in modal.tsx/dropdown.tsx) - Stories: Default, Loading, Empty, Error, Skeleton (min-h-layout-story) - Re-export from DataList.tsx Co-authored-by: Cursor <cursoragent@cursor.com>
28 lines
599 B
TypeScript
28 lines
599 B
TypeScript
import { cn } from '@/lib/utils';
|
||
|
||
const SKELETON_COUNT = 3;
|
||
|
||
interface DataListSkeletonProps {
|
||
className?: string;
|
||
count?: number;
|
||
}
|
||
|
||
/**
|
||
* Skeleton pour l’état Loading de DataList.
|
||
*/
|
||
export function DataListSkeleton({
|
||
className,
|
||
count = SKELETON_COUNT,
|
||
}: DataListSkeletonProps) {
|
||
return (
|
||
<div className={cn('space-y-2', className)}>
|
||
{Array.from({ length: count }).map((_, index) => (
|
||
<div
|
||
key={index}
|
||
className="animate-pulse bg-kodo-slate dark:bg-kodo-steel rounded h-16"
|
||
aria-hidden="true"
|
||
/>
|
||
))}
|
||
</div>
|
||
);
|
||
}
|