"use client";

interface AccessDeniedProps {
  reason: "not_authenticated" | "not_admin" | "no_user_record";
  onSignOut: () => void;
}

export function AccessDenied({ onSignOut }: AccessDeniedProps) {
  return (
    <div className="flex min-h-screen items-center justify-center">
      <div className="flex flex-col items-center gap-4 text-center">
        <h1 className="text-xl font-semibold text-gray-900">Access Denied</h1>
        <p className="text-sm text-gray-500">
          You don&apos;t have permission to access the admin dashboard.
        </p>
        <div className="flex gap-3">
          <button
            onClick={onSignOut}
            className="rounded-md bg-gray-900 px-4 py-2 text-sm text-white hover:bg-gray-700"
          >
            Sign out
          </button>
          <a
            href={process.env.NEXT_PUBLIC_STOREFRONT_URL ?? "/"}
            className="rounded-md border border-gray-300 px-4 py-2 text-sm text-gray-700 hover:bg-gray-50"
          >
            Go to storefront
          </a>
        </div>
      </div>
    </div>
  );
}
