import type React from "react" import { cn } from "../../utils/cn" import { UnifiedSkeleton, TextSkeleton, MediaSkeleton, InteractiveSkeleton } from "./unified-skeleton" interface ContentSkeletonProps { className?: string } /** * Paragraph skeleton with varying line lengths for natural appearance */ export function ParagraphSkeleton({ className, lines = 4 }: ContentSkeletonProps & { lines?: number }) { const lineWidths = ['w-full', 'w-full', 'w-5/6', 'w-3/4', 'w-4/5', 'w-2/3'] return (
{Array.from({ length: lines }).map((_, index) => ( ))}
) } /** * List skeleton for navigation menus, categories, etc. */ export function ListSkeleton({ className, items = 5, showIcons = false, showActions = false }: ContentSkeletonProps & { items?: number showIcons?: boolean showActions?: boolean }) { return (
{Array.from({ length: items }).map((_, index) => (
{showIcons && }
{showActions && (
)}
))}
) } /** * Table skeleton for data displays */ export function TableSkeleton({ className, rows = 5, columns = 4 }: ContentSkeletonProps & { rows?: number columns?: number }) { return (
{/* Table header */}
{Array.from({ length: columns }).map((_, index) => ( ))}
{/* Table rows */}
{Array.from({ length: rows }).map((_, rowIndex) => (
{Array.from({ length: columns }).map((_, colIndex) => ( ))}
))}
) } /** * Form skeleton for input fields and form layouts */ export function FormSkeleton({ className, fields = 4 }: ContentSkeletonProps & { fields?: number }) { return (
{Array.from({ length: fields }).map((_, index) => (
{index % 3 === 0 && ( )}
))}
) } /** * Navigation menu skeleton */ export function NavigationSkeleton({ className, items = 6, horizontal = true }: ContentSkeletonProps & { items?: number horizontal?: boolean }) { return ( ) } /** * Profile/user info skeleton */ export function ProfileSkeleton({ className, showBio = true, showStats = true }: ContentSkeletonProps & { showBio?: boolean showStats?: boolean }) { return (
{/* Avatar and basic info */}
{/* Bio/description */} {showBio && (
)} {/* Stats */} {showStats && (
)}
) } /** * Comment/review skeleton for user-generated content */ export function CommentSkeleton({ className, showRating = false, showReplies = false }: ContentSkeletonProps & { showRating?: boolean showReplies?: boolean }) { return (
{/* User info */}
{showRating && (
{Array.from({ length: 5 }).map((_, i) => ( ))}
)}
{/* Comment content */}
{/* Actions */}
{/* Replies */} {showReplies && (
{Array.from({ length: 2 }).map((_, index) => (
))}
)}
) } /** * Feature list skeleton for product features, specifications, etc. */ export function FeatureListSkeleton({ className, features = 6, showIcons = true, grouped = false }: ContentSkeletonProps & { features?: number showIcons?: boolean grouped?: boolean }) { if (grouped) { // Grouped features with sections return (
{Array.from({ length: 3 }).map((_, groupIndex) => (
{Array.from({ length: features / 3 }).map((_, featureIndex) => (
{showIcons && }
))}
))}
) } // Simple feature list return (
{Array.from({ length: features }).map((_, index) => (
{showIcons && }
))}
) } /** * Timeline/activity skeleton */ export function TimelineSkeleton({ className, items = 5 }: ContentSkeletonProps & { items?: number }) { return (
{Array.from({ length: items }).map((_, index) => (
{index < items - 1 && (
)}
))}
) } /** * Pricing/plan skeleton */ export function PricingSkeleton({ className, plans = 3 }: ContentSkeletonProps & { plans?: number }) { return (
{Array.from({ length: plans }).map((_, index) => (
{/* Plan name */} {/* Price */}
{/* Features */}
{Array.from({ length: 5 }).map((_, featureIndex) => (
))}
{/* CTA Button */}
))}
) }