// import React from 'react';
interface SkeletonBarProps {
width?: string;
height?: string;
className?: string;
}
// 基础骨架条
export function SkeletonBar({ width = 'w-full', height = 'h-5', className = '' }: SkeletonBarProps) {
return (
);
}
// 通用骨架屏
export function SkeletonScreen() {
return (
);
}
// 数字统计骨架
export function NumberSkeleton({ className = '' }: { className?: string }) {
return (
);
}
// 表格行骨架屏
interface TableRowSkeletonProps {
count?: number;
className?: string;
}
export function TableRowSkeleton({ count = 5, className = '' }: TableRowSkeletonProps) {
return (
{Array(count).fill(0).map((_, index) => (
))}
);
}
// 自定义列宽的表格行骨架屏
interface CustomTableRowSkeletonProps {
count?: number;
columns: Array<{
width: string;
rows?: Array<{
width: string;
height?: string;
className?: string;
}>;
}>;
className?: string;
}
export function CustomTableRowSkeleton({ count = 5, columns, className = '' }: CustomTableRowSkeletonProps) {
return (
{Array(count).fill(0).map((_, rowIndex) => (
{columns.map((column, colIndex) => (
{column.rows ? (
column.rows.map((row, rowIdx) => (
))
) : (
)}
))}
))}
);
}
// 加载指示器
export function LoadingIndicator({ text = '正在加载数据...' }: { text?: string }) {
return (
);
}