import PageContainer from '@/components/layout/page-container';
import { Card, CardContent, CardHeader } from '@/components/ui/card';
import { Skeleton } from '@/components/ui/skeleton';

export default function Loading() {
  return (
    <PageContainer pageTitle='รายงาน' pageDescription='กำลังโหลดรายงานและข้อมูลส่งออก...'>
      <div className='space-y-6'>
        <Card>
          <CardHeader>
            <Skeleton className='h-6 w-40' />
            <Skeleton className='h-4 w-80 max-w-full' />
          </CardHeader>
          <CardContent className='grid gap-4 md:grid-cols-4'>
            <Skeleton className='h-10 w-full' />
            <Skeleton className='h-10 w-full' />
            <Skeleton className='h-10 w-full' />
            <Skeleton className='h-10 w-full' />
          </CardContent>
        </Card>
        <div className='grid gap-4 md:grid-cols-3'>
          {Array.from({ length: 3 }).map((_, index) => (
            <Card key={index}>
              <CardHeader className='pb-2'>
                <Skeleton className='h-4 w-28' />
                <Skeleton className='h-8 w-16' />
              </CardHeader>
              <CardContent>
                <Skeleton className='h-6 w-24' />
              </CardContent>
            </Card>
          ))}
        </div>
        {Array.from({ length: 3 }).map((_, index) => (
          <Card key={index}>
            <CardHeader className='flex flex-col gap-3 md:flex-row md:items-start md:justify-between'>
              <div className='space-y-2'>
                <Skeleton className='h-6 w-52' />
                <Skeleton className='h-4 w-80 max-w-full' />
              </div>
              <Skeleton className='h-8 w-24' />
            </CardHeader>
            <CardContent className='space-y-3'>
              {Array.from({ length: 4 }).map((__, rowIndex) => (
                <Skeleton key={rowIndex} className='h-10 w-full' />
              ))}
            </CardContent>
          </Card>
        ))}
      </div>
    </PageContainer>
  );
}
