import { jsxs, jsx, Fragment } from "react/jsx-runtime"; import { useForm } from "@inertiajs/react"; import { u as useRoute } from "../app.js"; import { u as useTypedPage } from "./useTypedPage-Do3SqtsL.js"; import { A as ActionMessage } from "./ActionMessage-s_mcCJ3s.js"; import { F as FormSection } from "./FormSection-DI6t3wFC.js"; import { T as TextInput, I as InputError } from "./TextInput-CMJy2hIv.js"; import { I as InputLabel } from "./InputLabel-DhqxoV6M.js"; import { P as PrimaryButton } from "./PrimaryButton-C2B8UWiv.js"; import classNames from "classnames"; import "axios"; import "lodash"; import "react-dom/client"; import "react"; import "@headlessui/react"; import "./SectionTitle-DnuUNpyS.js"; function CreateTeamForm() { var _a, _b, _c, _d; const route = useRoute(); const page = useTypedPage(); const form = useForm({ name: "" }); function createTeam() { form.post(route("teams.store"), { errorBag: "createTeam", preserveScroll: true }); } return /* @__PURE__ */ jsxs( FormSection, { onSubmit: createTeam, title: "Team Details", description: "Create a new team to collaborate with others on projects.", renderActions: () => /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(ActionMessage, { on: form.recentlySuccessful, className: "mr-3", children: "Saved." }), /* @__PURE__ */ jsx( PrimaryButton, { className: classNames({ "opacity-25": form.processing }), disabled: form.processing, children: "Save" } ) ] }), children: [ /* @__PURE__ */ jsxs("div", { className: "col-span-6", children: [ /* @__PURE__ */ jsx(InputLabel, { value: "Team Owner" }), /* @__PURE__ */ jsxs("div", { className: "flex items-center mt-2", children: [ /* @__PURE__ */ jsx( "img", { className: "w-12 h-12 rounded-full object-cover", src: (_a = page.props.auth.user) == null ? void 0 : _a.profile_photo_url, alt: (_b = page.props.auth.user) == null ? void 0 : _b.name } ), /* @__PURE__ */ jsxs("div", { className: "ml-4 leading-tight", children: [ /* @__PURE__ */ jsx("div", { className: "text-gray-900 dark:text-white", children: (_c = page.props.auth.user) == null ? void 0 : _c.name }), /* @__PURE__ */ jsx("div", { className: "text-gray-700 dark:text-gray-300 text-sm", children: (_d = page.props.auth.user) == null ? void 0 : _d.email }) ] }) ] }) ] }), /* @__PURE__ */ jsxs("div", { className: "col-span-6 sm:col-span-4", children: [ /* @__PURE__ */ jsx(InputLabel, { htmlFor: "name", value: "Team Name" }), /* @__PURE__ */ jsx( TextInput, { id: "name", type: "text", className: "mt-1 block w-full", value: form.data.name, onChange: (e) => form.setData("name", e.currentTarget.value), autoFocus: true } ), /* @__PURE__ */ jsx(InputError, { message: form.errors.name, className: "mt-2" }) ] }) ] } ); } export { CreateTeamForm as default };