"use client";
import { jsxs, jsx } from 'react/jsx-runtime';
import { ArrowLeft } from 'lucide-react';
import { Card, CardHeader, CardTitle, CardDescription, CardContent } from '../../../../../../../ui/src/components/card.mjs';
import { usePluginOverrides } from '@btst/stack/context';
import { BoardForm } from '../forms/board-form.mjs';
import { PageWrapper } from '../shared/page-wrapper.mjs';

function NewBoardPage() {
  const { Link: OverrideLink, navigate: overrideNavigate } = usePluginOverrides("kanban");
  const navigate = overrideNavigate || ((path) => {
    window.location.href = path;
  });
  const Link = OverrideLink || "a";
  const handleSuccess = (boardId) => {
    navigate(`/pages/kanban/${boardId}`);
  };
  return /* @__PURE__ */ jsxs(PageWrapper, { "data-testid": "new-board-page", children: [
    /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4 mb-8", children: [
      /* @__PURE__ */ jsx(
        Link,
        {
          href: "/pages/kanban",
          className: "text-muted-foreground hover:text-foreground",
          children: /* @__PURE__ */ jsx(ArrowLeft, { className: "h-5 w-5" })
        }
      ),
      /* @__PURE__ */ jsxs("div", { children: [
        /* @__PURE__ */ jsx("h1", { className: "text-3xl font-bold", "data-testid": "page-header", children: "Create New Board" }),
        /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mt-1", children: "Set up a new kanban board for your project" })
      ] })
    ] }),
    /* @__PURE__ */ jsxs(Card, { className: "max-w-2xl", children: [
      /* @__PURE__ */ jsxs(CardHeader, { children: [
        /* @__PURE__ */ jsx(CardTitle, { children: "Board Details" }),
        /* @__PURE__ */ jsx(CardDescription, { children: "Enter the details for your new kanban board." })
      ] }),
      /* @__PURE__ */ jsx(CardContent, { children: /* @__PURE__ */ jsx(
        BoardForm,
        {
          onClose: () => navigate("/pages/kanban"),
          onSuccess: handleSuccess
        }
      ) })
    ] })
  ] });
}

export { NewBoardPage };
