import React from 'react'; const Pulse = ({ className }: { className: string }) => (
); const SkeletonSwitch = () => (
); interface RowProps { labelW?: string; descW?: string; badge?: boolean; right?: React.ReactNode; } const Row = ({ labelW = 'w-40', descW = 'w-64', badge = false, right }: RowProps) => (
{badge && }
{right ?? }
); const Buttons = () => (
); function GeneralSkeleton() { return (
} /> } />
); } function ThumbnailsSkeleton() { const rows: Array<[string, string]> = [ ['w-28', 'w-64'], ['w-36', 'w-72'], ['w-32', 'w-68'], ['w-44', 'w-72'], ['w-32', 'w-72'], ['w-36', 'w-72'], ['w-36', 'w-72'], ['w-32', 'w-72'], ]; return (
{rows.map(([lw, dw], i) => ( ))}
); } function DuplicateSkeleton() { return (
); } function CompressSkeleton() { return (
} />
); } function TwoSwitchSkeleton() { return (
); } function SocialSkeleton() { const platforms: Array<[string, string]> = [ ['w-20', 'w-64'], ['w-20', 'w-52'], ['w-16', 'w-56'], ['w-20', 'w-60'], ]; return (
{platforms.map(([lw, dw], i) => (
))}
); } function DebugSkeleton() { type Section = { hw: string; rows: Array<[string, string]> }; const sections: Section[] = [ { hw: 'w-16', rows: [ ['w-24', 'w-16'], ['w-8', 'w-12'], ['w-14', 'w-16'], ['w-12', 'w-24'], ['w-32', 'w-12'], ['w-28', 'w-8' ], ['w-36', 'w-16'], ['w-40', 'w-10'], ['w-24', 'w-16'], ], }, { hw: 'w-36', rows: [ ['w-20', 'w-20'], ['w-32', 'w-20'], ['w-28', 'w-20'], ], }, { hw: 'w-28', rows: [ ['w-16', 'w-12'], ['w-20', 'w-20'], ['w-28', 'w-20'], ['w-24', 'w-12'], ['w-20', 'w-20'], ['w-36', 'w-20'], ['w-24', 'w-20'], ['w-28', 'w-20'], ['w-24', 'w-16'], ['w-32', 'w-20'], ['w-36', 'w-48'], ], }, { hw: 'w-28', rows: [ ['w-12', 'w-36'], ['w-16', 'w-8' ], ], }, { hw: 'w-32', rows: [ ['w-24', 'w-20'], ['w-32', 'w-8' ], ], }, ]; return (
{sections.map((section, si) => (
{section.rows.map(([lw, vw], ri) => (
))}
))}
); } const TAB_SLUGS = [ 'general', 'thumbnails', 'duplicate-images', 'compress-images', 'convert-to-webp', 'convert-to-avif', 'social-share-image', 'debug', ]; const TAB_WIDTHS = ['w-16', 'w-24', 'w-36', 'w-32', 'w-32', 'w-32', 'w-40', 'w-14']; const CARD_TITLE_WIDTHS: Record = { general: 'w-36', thumbnails: 'w-44', 'duplicate-images': 'w-56', 'compress-images': 'w-52', 'convert-to-webp': 'w-36', 'convert-to-avif': 'w-36', 'social-share-image':'w-48', debug: 'w-40', }; const CONTENT_MAP: Record = { general: GeneralSkeleton, thumbnails: ThumbnailsSkeleton, 'duplicate-images': DuplicateSkeleton, 'compress-images': CompressSkeleton, 'convert-to-webp': TwoSwitchSkeleton, 'convert-to-avif': TwoSwitchSkeleton, 'social-share-image':SocialSkeleton, debug: DebugSkeleton, }; export default function SettingsSkeleton({ activeTab }: { activeTab: string }) { const Content = CONTENT_MAP[activeTab] ?? GeneralSkeleton; const titleW = CARD_TITLE_WIDTHS[activeTab] ?? 'w-40'; return (
{/* Tab bar */}
{TAB_SLUGS.map((slug, i) => (
))}
{/* Card */}
); }