1import{j as e}from"./vendor-markdown-DIW4cXdl.js";import{l as f,d as v,r as m}from"./vendor-react-DISSCkJ-.js";import{g as h,y as c}from"./index-C1i21spu.js";import{f as j,g as S}from"./useWpContent-j8NZU9Ck.js";import{u as w}from"./vendor-i18n-B3RrgeHp.js";import{A as N}from"./arrow-left-W2MnAuNP.js";import"./vendor-redux-BUAhM-cm.js";import"./vendor-clerk-BTxT0tL0.js";import"./vendor-socket-DElUTK9t.js";const y=["UTC","Asia/Kolkata","America/New_York","America/Los_Angeles","Europe/London","Europe/Paris","Asia/Tokyo","Australia/Sydney"];function L(){const{id:o}=f(),p=v(),{t:s}=w(),{data:a,isLoading:u,isError:g}=j(o),r=S(o),[i,l]=m.useState({title:"",description:"",timezone:"UTC",date_format:"F j, Y",time_format:"g:i a"});m.useEffect(()=>{a&&l({title:a.title??"",description:a.description??"",timezone:a.timezone??"UTC",date_format:a.date_format??"F j, Y",time_format:a.time_format??"g:i a"})},[a]);function n(t,x){l(b=>({...b,[t]:x}))}function d(t){t?.preventDefault?.(),r.mutate(i,{onSuccess:()=>c.success(s("wpSettings.saveSuccess")),onError:()=>c.error(s("wpSettings.saveFailed"))})}return g?e.jsx("div",{className:"p-6",children:e.jsx("div",{className:"rounded-xl border border-red-200 bg-red-50 p-4 text-sm text-red-600",children:s("wpSettings.loadError")})}):u?e.jsx("div",{className:"p-6 text-sm text-[var(--color-text-muted)]",children:s("wpSettings.loading")}):e.jsxs("div",{className:"max-w-2xl mx-auto p-6 space-y-5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("button",{onClick:()=>p(`/websites/${o}`),className:"text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:e.jsx(N,{size:18})}),e.jsx("h1",{className:"text-xl font-semibold",children:s("wpSettings.title")})]}),e.jsxs("form",{onSubmit:d,className:"space-y-5",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:s("wpSettings.siteTitle")}),e.jsx("input",{className:"w-full border border-[var(--color-border)] rounded-lg px-3 py-2 text-sm bg-transparent",value:i.title,onChange:t=>n("title",t.target.value),disabled:r.isPending})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:s("wpSettings.tagline")}),e.jsx("input",{className:"w-full border border-[var(--color-border)] rounded-lg px-3 py-2 text-sm bg-transparent",value:i.description,onChange:t=>n("description",t.target.value),disabled:r.isPending})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:s("wpSettings.timezone")}),e.jsx("select",{className:"border border-[var(--color-border)] rounded-lg px-3 py-2 text-sm bg-transparent w-full",value:i.timezone,onChange:t=>n("timezone",t.target.value),disabled:r.isPending,children:y.map(t=>e.jsx("option",{value:t,children:t},t))})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:s("wpSettings.dateFormat")}),e.jsx("input",{className:"w-full border border-[var(--color-border)] rounded-lg px-3 py-2 text-sm bg-transparent",value:i.date_format,onChange:t=>n("date_format",t.target.value),disabled:r.isPending})]}),e.jsxs("div",{children:[e.jsx("label",{className:"block text-sm font-medium mb-1",children:s("wpSettings.timeFormat")}),e.jsx("input",{className:"w-full border border-[var(--color-border)] rounded-lg px-3 py-2 text-sm bg-transparent",value:i.time_format,onChange:t=>n("time_format",t.target.value),disabled:r.isPending})]})]}),e.jsx(h,{type:"primary",mt:"mt-0",fullWidth:!1,isLoading:r.isPending,onClick:d,children:r.isPending?s("wpSettings.saving"):s("wpSettings.saveButton")})]})]})}export{L as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.