import { Suspense } from "react";
import { LayoutConfigurationsTable } from "@/app/components/layout-configurations/LayoutConfigurationsTable";
import { CreateLayoutConfigurationDialog } from "@/app/components/layout-configurations/CreateLayoutConfigurationDialog";
import { Skeleton } from "@/components/ui/skeleton";

export default function LayoutConfigurationsPage() {
  return (
    <div className="container mx-auto py-8 px-4">
      <div className="flex justify-between items-center mb-6">
        <h1 className="text-3xl font-bold">Layout Configurations</h1>
        <CreateLayoutConfigurationDialog />
      </div>
      
      <div className="bg-white rounded-lg shadow">
        <Suspense fallback={<LayoutConfigurationsSkeleton />}>
          <LayoutConfigurationsTable />
        </Suspense>
      </div>
    </div>
  );
}

function LayoutConfigurationsSkeleton() {
  return (
    <div className="p-4 space-y-4">
      {[...Array(5)].map((_, i) => (
        <div key={i} className="flex items-center space-x-4">
          <Skeleton className="h-12 w-full" />
        </div>
      ))}
    </div>
  );
}