import * as React from 'react'; import { cn } from '@/lib/utils'; /** * Skeleton base — animated pulse placeholder. */ function SkeletonBase({ className, ...props }: React.HTMLAttributes) { return (
); } /** Skeleton.Row — một hàng text placeholder */ function SkeletonRow({ className, ...props }: React.HTMLAttributes) { return (
); } /** Skeleton.Card — card placeholder */ function SkeletonCard({ className, ...props }: React.HTMLAttributes) { return (
); } /** Skeleton.Table — table placeholder */ function SkeletonTable({ rows = 5, className, ...props }: React.HTMLAttributes & { rows?: number }) { return (
{/* header */}
{Array.from({ length: rows }).map((_, i) => ( ))}
); } export const Skeleton = Object.assign(SkeletonBase, { Row: SkeletonRow, Card: SkeletonCard, Table: SkeletonTable, }); export type SkeletonProps = React.HTMLAttributes;