'use client' import React from 'react' import { Card, CardContent } from '@/components/ui/card' import { Button } from '@/components/ui/button' import { Loader2, AlertCircle, RefreshCw, FileX, Layers } from 'lucide-react' interface LoadingStatesProps { type: 'loading' | 'error' | 'empty' message?: string onRetry?: () => void } const LoadingStates: React.FC = ({ type, message, onRetry }) => { if (type === 'loading') { return (

Loading Layouts

{message || 'Discovering and loading layout components...'}

{/* Loading animation dots */}
) } if (type === 'error') { return (

Something went wrong

{message || 'Failed to load layouts. Please check your layout files and try again.'}

{onRetry && ( )}
) } if (type === 'empty') { return (

No Layouts Found

No valid layout files were discovered. Make sure your layout components export both a default component and a Schema.

Expected structure:

export default MyLayout
export const Schema = z.object(...)
{onRetry && ( )}
) } return null } // Component for layout grid skeleton while loading export const LayoutGridSkeleton: React.FC = () => { return (
{/* Header Skeleton */}
{/* Main Content Skeleton */}
{/* Sidebar Skeleton */}
{[...Array(6)].map((_, i) => (
))}
{/* Main Display Skeleton */}
) } export default LoadingStates