import { jsx, jsxs } from "react/jsx-runtime";
import { T as Tabs } from "./tabs-DgXFE6Gu.js";
import { T as TabsList, a as TabsTrigger, b as TabsContent } from "./tabs-DmCK9qzK.js";
import { D as DashboardLayout } from "./layout-Cf9mPjOS.js";
import { g as getQueryParams } from "./route-DlE7FdTW.js";
import { usePage, router } from "@inertiajs/react";
import Google from "./google-DRVykPao.js";
import Recaptcha from "./recaptcha-BX03NYRM.js";
import "react";
import "@radix-ui/react-tabs";
import "./utils-DLCPGU0v.js";
import "clsx";
import "tailwind-merge";
import "./sidebar-C1tqSfnl.js";
import "@radix-ui/react-slot";
import "class-variance-authority";
import "lucide-react";
import "./button-CdJZJLGw.js";
import "./separator-CSqU-rrB.js";
import "@radix-ui/react-separator";
import "./sheet-BOQ-e9_C.js";
import "@radix-ui/react-dialog";
import "./tooltip-BYKuzaoQ.js";
import "@radix-ui/react-tooltip";
import "./main-BKBelQb-.js";
import "next-themes";
import "sonner";
import "./appearance-BJIqrZL5.js";
import "./dropdown-menu-msun3TP8.js";
import "@radix-ui/react-dropdown-menu";
import "./language-mewnB-2r.js";
import "./notification-Bg6IzWOo.js";
import "./popover-Cv6Hz_y0.js";
import "@radix-ui/react-popover";
import "date-fns";
import "./scroll-area-CDdrLubh.js";
import "@radix-ui/react-scroll-area";
import "./app-logo-DWyi5bLn.js";
import "./accordion-cIAfVfPq.js";
import "@radix-ui/react-accordion";
import "./avatar-C8iCpF5R.js";
import "@radix-ui/react-avatar";
import "./use-lang-44ndmTOc.js";
import "./input-error-D1JIzedA.js";
import "./loading-button-CCIxhJrY.js";
import "./switch-ad-BDGs-.js";
import "./switch-CEzDpTwE.js";
import "@radix-ui/react-switch";
import "./card-B-gBwpxd.js";
import "./input-BsvJqbcd.js";
import "./label-0rIIfpX0.js";
import "@radix-ui/react-label";
import "./inertia-BtwbgBI3.js";
const Auth = ({ auths }) => {
  const { props, url } = usePage();
  const params = getQueryParams(url);
  const { translate } = props;
  const { common } = translate;
  const tabs = auths.map((auth) => {
    let Component;
    switch (auth.sub_type) {
      case "google":
        Component = Google;
        break;
      case "recaptcha":
        Component = Recaptcha;
        break;
      default:
        Component = ({ auth: auth2 }) => /* @__PURE__ */ jsx("div", { children: "No component found" });
        break;
    }
    return {
      ...auth,
      Component
    };
  });
  return /* @__PURE__ */ jsx("section", { className: "md:px-3", children: /* @__PURE__ */ jsxs(Tabs, { value: params["tab"] ?? tabs[0].sub_type, className: "grid grid-rows-1 gap-5 md:grid-cols-4", children: [
    /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(TabsList, { className: "horizontal-tabs-list", children: tabs.map(({ id, title, sub_type }) => /* @__PURE__ */ jsx(
      TabsTrigger,
      {
        value: sub_type,
        className: "horizontal-tabs-trigger",
        onClick: () => router.get(
          route("settings.auth0", {
            tab: sub_type
          })
        ),
        children: title
      },
      id
    )) }) }),
    /* @__PURE__ */ jsx("div", { className: "md:col-span-3", children: tabs.map((auth) => /* @__PURE__ */ jsx(TabsContent, { value: auth.sub_type, className: "m-0", children: /* @__PURE__ */ jsx(auth.Component, { auth }, auth.id) }, auth.id)) })
  ] }) });
};
Auth.layout = (page) => /* @__PURE__ */ jsx(DashboardLayout, { children: page });
export {
  Auth as default
};
