"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import { useSearchParams } from "next/navigation";
import { useTranslations } from "next-intl";
import { ShieldAlert, ArrowLeft } from "lucide-react";
import { Button } from "../../ui/button.js";
function AuthErrorPage() {
  const searchParams = useSearchParams();
  const t = useTranslations("auth.error");
  const error = searchParams.get("error");
  const code = (error == null ? void 0 : error.toLowerCase()) ?? "";
  const isAccountError = code === "unable_to_create_user" || code === "unable_to_create_session" || code === "user_not_found";
  const titleKey = isAccountError ? "unable_to_create.title" : "generic.title";
  const descriptionKey = isAccountError ? "unable_to_create.description" : "generic.description";
  return /* @__PURE__ */ jsxs("div", { className: "space-y-6", "data-cy": "auth-error-page", children: [
    /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx("div", { className: "rounded-full p-4 bg-destructive/10", children: /* @__PURE__ */ jsx(ShieldAlert, { className: "h-8 w-8 text-destructive", strokeWidth: 1.5 }) }) }),
    /* @__PURE__ */ jsxs("div", { className: "text-center space-y-2", children: [
      /* @__PURE__ */ jsx(
        "h1",
        {
          className: "text-xl font-semibold text-foreground",
          "data-cy": "auth-error-title",
          children: t(titleKey)
        }
      ),
      /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground leading-relaxed", children: t(descriptionKey) })
    ] }),
    /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-2 pt-2", children: /* @__PURE__ */ jsx(
      Button,
      {
        asChild: true,
        className: "w-full",
        "data-cy": "auth-error-back-to-login",
        children: /* @__PURE__ */ jsxs("a", { href: "/login", children: [
          /* @__PURE__ */ jsx(ArrowLeft, { className: "mr-2 h-4 w-4" }),
          t("backToLogin")
        ] })
      }
    ) })
  ] });
}
export {
  AuthErrorPage
};
