diff --git a/frontend/src/components/ui/Skeleton.tsx b/frontend/src/components/ui/Skeleton.tsx new file mode 100644 index 000000000..e3cce7c3d --- /dev/null +++ b/frontend/src/components/ui/Skeleton.tsx @@ -0,0 +1,132 @@ +import React from 'react'; +import { motion } from 'framer-motion'; + +interface SkeletonProps { + className?: string; + variant?: 'text' | 'rectangular' | 'circular'; + width?: string | number; + height?: string | number; + animate?: boolean; +} + +export function Skeleton({ + className = '', + variant = 'text', + width, + height, + animate = true, +}: SkeletonProps) { + const baseClasses = 'bg-forge-800'; + const variantClasses = { + text: 'rounded h-4', + rectangular: 'rounded-lg', + circular: 'rounded-full', + }; + + const style: React.CSSProperties = { + width: width ?? (variant === 'text' ? '100%' : undefined), + height: height ?? (variant === 'text' ? '1rem' : undefined), + }; + + if (!animate) { + return ( +
+ ); + } + + return ( +