import { Skeleton } from "@heroui/react";

export function OrderDetailSkeleton() {
  return (
    <div className="space-y-6">
      {/* Breadcrumbs */}
      <div className="flex items-center gap-2">
        <Skeleton className="h-4 w-16 rounded" />
        <span className="text-gray-300">/</span>
        <Skeleton className="h-4 w-16 rounded" />
        <span className="text-gray-300">/</span>
        <Skeleton className="h-4 w-28 rounded" />
      </div>

      {/* Header */}
      <div className="space-y-3">
        <div className="flex flex-col gap-2 md:flex-row md:items-center md:justify-between">
          <Skeleton className="h-8 w-52 rounded" />
          <div className="flex gap-2">
            <Skeleton className="h-6 w-20 rounded-full" />
            <Skeleton className="h-6 w-16 rounded-full" />
          </div>
        </div>
        <Skeleton className="h-4 w-44 rounded" />
      </div>

      {/* Main grid */}
      <div className="grid grid-cols-1 gap-6 lg:grid-cols-3">
        {/* Left column */}
        <div className="space-y-6 lg:col-span-2">
          {/* Items card */}
          <div className="rounded-xl border border-gray-100 bg-white p-4">
            <Skeleton className="mb-4 h-5 w-24 rounded" />
            {Array.from({ length: 3 }).map((_, i) => (
              <div key={i} className="flex gap-3 py-3">
                <Skeleton className="h-16 w-16 shrink-0 rounded-md" />
                <div className="flex flex-1 flex-col gap-2">
                  <Skeleton className="h-4 w-3/4 rounded" />
                  <Skeleton className="h-3 w-1/2 rounded" />
                  <Skeleton className="h-3 w-1/3 rounded" />
                </div>
              </div>
            ))}
          </div>

          {/* Tracking card */}
          <div className="space-y-3 rounded-xl border border-gray-100 bg-white p-4">
            <Skeleton className="h-5 w-36 rounded" />
            <Skeleton className="h-4 w-1/2 rounded" />
            <Skeleton className="h-4 w-2/3 rounded" />
          </div>

          {/* Addresses */}
          <div className="grid grid-cols-1 gap-4 md:grid-cols-2">
            {[0, 1].map((i) => (
              <div
                key={i}
                className="space-y-2 rounded-xl border border-gray-100 bg-white p-4"
              >
                <Skeleton className="h-4 w-28 rounded" />
                <Skeleton className="h-4 w-36 rounded" />
                <Skeleton className="h-4 w-40 rounded" />
                <Skeleton className="h-4 w-24 rounded" />
              </div>
            ))}
          </div>
        </div>

        {/* Right column — price summary */}
        <div className="space-y-3 rounded-xl border border-gray-100 bg-white p-4">
          <Skeleton className="h-5 w-28 rounded" />
          {Array.from({ length: 4 }).map((_, i) => (
            <div key={i} className="flex justify-between">
              <Skeleton className="h-4 w-16 rounded" />
              <Skeleton className="h-4 w-20 rounded" />
            </div>
          ))}
          <div className="flex justify-between pt-2">
            <Skeleton className="h-5 w-12 rounded" />
            <Skeleton className="h-5 w-24 rounded" />
          </div>
        </div>
      </div>

      {/* Actions */}
      <div className="flex gap-3">
        <Skeleton className="h-10 w-32 rounded-lg" />
        <Skeleton className="h-10 w-28 rounded-lg" />
        <Skeleton className="h-10 w-32 rounded-lg" />
      </div>
    </div>
  );
}
