import React from 'react'; import { Box, Group, Stack } from '@mantine/core'; interface SkeletonLoaderProps { type: 'pageGrid' | 'fileGrid' | 'controls' | 'viewer' | 'block'; count?: number; animated?: boolean; width?: number | string; height?: number | string; radius?: number | string; } const SkeletonLoader: React.FC = ({ type, count = 8, animated = true, width, height, radius = 8, }) => { const animationStyle = animated ? { animation: 'pulse 2s infinite' } : {}; // Generic block skeleton for inline text/inputs/etc. const renderBlock = () => ( ); const renderPageGridSkeleton = () => (
{Array.from({ length: count }).map((_, i) => ( ))}
); const renderFileGridSkeleton = () => (
{Array.from({ length: count }).map((_, i) => ( ))}
); const renderControlsSkeleton = () => ( ); const renderViewerSkeleton = () => ( {/* Toolbar skeleton */} {/* Main content skeleton */} ); switch (type) { case 'block': return renderBlock(); case 'pageGrid': return renderPageGridSkeleton(); case 'fileGrid': return renderFileGridSkeleton(); case 'controls': return renderControlsSkeleton(); case 'viewer': return renderViewerSkeleton(); default: return null; } }; export default SkeletonLoader;