import { jsx, jsxs } from "react/jsx-runtime"; import { I as InputError } from "./input-error-D1JIzedA.js"; import { L as LoadingButton } from "./loading-button-CCIxhJrY.js"; import { B as Button } from "./button-CdJZJLGw.js"; import { C as Card } from "./card-B-gBwpxd.js"; import { I as Input } from "./input-BsvJqbcd.js"; import { L as Label } from "./label-0rIIfpX0.js"; import { S as Separator } from "./separator-CSqU-rrB.js"; import { D as DashboardLayout } from "./layout-Cf9mPjOS.js"; import { usePage, useForm, Link } from "@inertiajs/react"; import { MoveLeft } from "lucide-react"; import "./utils-DLCPGU0v.js"; import "clsx"; import "tailwind-merge"; import "react"; import "@radix-ui/react-slot"; import "class-variance-authority"; import "@radix-ui/react-label"; import "@radix-ui/react-separator"; import "./sidebar-C1tqSfnl.js"; 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 "./route-DlE7FdTW.js"; import "./avatar-C8iCpF5R.js"; import "@radix-ui/react-avatar"; import "./use-lang-44ndmTOc.js"; const SMTP = ({ property }) => { const { props } = usePage(); const { translate } = props; const { button } = translate; const { data, setData, put, errors, processing } = useForm(property.properties); const handleSubmit = (e) => { e.preventDefault(); put(route("language.property.update", property.id)); }; return /* @__PURE__ */ jsx("div", { className: "md:px-3", children: /* @__PURE__ */ jsx(Card, { className: "p-4 sm:p-6", children: /* @__PURE__ */ jsxs("form", { onSubmit: handleSubmit, className: "space-y-6", children: [ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4", children: [ /* @__PURE__ */ jsx("h2", { className: "text-xl font-semibold", children: property.name }), /* @__PURE__ */ jsx(Link, { href: route("language.edit", property.language.code), children: /* @__PURE__ */ jsxs(Button, { children: [ /* @__PURE__ */ jsx(MoveLeft, {}), button.back ] }) }) ] }), /* @__PURE__ */ jsx(Separator, {}), /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 gap-6 md:grid-cols-2", children: Object.entries(data).map(([key, value]) => /* @__PURE__ */ jsxs("div", { children: [ /* @__PURE__ */ jsx(Label, { children: key }), /* @__PURE__ */ jsx( Input, { name: key, value: data[key], placeholder: "Enter value", onChange: (e) => setData(e.target.name, e.target.value) } ), /* @__PURE__ */ jsx(InputError, { message: errors[key] }) ] }, key)) }), /* @__PURE__ */ jsx(Separator, {}), /* @__PURE__ */ jsx("div", { className: "flex items-center justify-end", children: /* @__PURE__ */ jsx(LoadingButton, { loading: processing, children: button.save }) }) ] }) }) }); }; SMTP.layout = (page) => /* @__PURE__ */ jsx(DashboardLayout, { children: page }); export { SMTP as default };