"use client";

import IOSSpinner from "./IOSSpinner";
import { cn } from "@/lib/utils";

interface PageLoaderProps {
  className?: string;
  label?: string;
  size?: number;
}

/** Centered iOS-style page loader — use instead of GIF / border spinners */
export default function PageLoader({
  className,
  label,
  size = 28,
}: PageLoaderProps) {
  return (
    <div
      className={cn(
        "flex flex-col items-center justify-center gap-2 py-8",
        className
      )}
    >
      <IOSSpinner size={size} color="#007aff" />
      {label && <span className="text-sm text-neutral-500">{label}</span>}
    </div>
  );
}
