import { Package, Search } from "lucide-react";
import { Button } from "@edr/ui-common";
import { bookingSurface } from "./booking-ui.styles";

interface BookingTableEmptyProps {
  isError?: boolean;
  hasSearch?: boolean;
  onRetry?: () => void;
}

export function BookingTableEmpty({
  isError,
  hasSearch,
  onRetry,
}: BookingTableEmptyProps) {
  return (
    <div className={bookingSurface.emptyState}>
      <div className="flex size-14 items-center justify-center rounded-2xl bg-muted text-muted-foreground">
        {hasSearch ? <Search className="size-6" /> : <Package className="size-6" />}
      </div>
      <div className="max-w-sm space-y-1">
        <h3 className="text-base font-semibold text-foreground">
          {isError
            ? "Could not load bookings"
            : hasSearch
              ? "No matches on this page"
              : "No bookings with this status"}
        </h3>
        <p className="text-sm text-muted-foreground">
          {isError
            ? "Check your connection and try again."
            : hasSearch
              ? "Try a different reference or customer name."
              : "New customer submissions will appear when status is Submitted."}
        </p>
      </div>
      {isError && onRetry && (
        <Button variant="outline" size="sm" onClick={onRetry}>
          Retry
        </Button>
      )}
    </div>
  );
}
