1import{u as j,w as v,r as n,j as e,s as b}from"./main-Bo0oayNO.js";import{S as N}from"./SetupLayout-CdfExr2y.js";function y(){const r=j(),i=v.useLoaderData(),[o,c]=n.useState(!1),[m,d]=n.useState(null),[t,u]=n.useState({siteTitle:i.siteTitle||"My StackPress Site",siteDescription:i.siteDescription||"Just another StackPress site",siteUrl:i.siteUrl||(typeof window<"u"?window.location.origin:"http://localhost:3000"),adminEmail:i.adminEmail||"",timezone:i.timezone||"UTC",dateFormat:i.dateFormat||"YYYY-MM-DD",timeFormat:i.timeFormat||"24h"}),s=l=>{const{name:a,value:p}=l.target;u(x=>({...x,[a]:p}))},h=async l=>{l.preventDefault(),c(!0),d(null);try{await b({data:t}),r({to:"/setup/admin"})}catch(a){d(a instanceof Error?a.message:"Failed to save site information")}finally{c(!1)}};return e.jsx(N,{currentStep:2,totalSteps:4,title:"Site Information",description:"Tell us about your new site.",children:e.jsxs("form",{onSubmit:h,className:"space-y-6",children:[m&&e.jsx("div",{className:"bg-red-50 border border-red-200 text-red-700 px-4 py-3 rounded-lg text-sm",children:m}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"siteTitle",className:"label",children:["Site Title ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"text",id:"siteTitle",name:"siteTitle",value:t.siteTitle,onChange:s,required:!0,className:"input",placeholder:"My Awesome Site"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"siteDescription",className:"label",children:"Site Description"}),e.jsx("textarea",{id:"siteDescription",name:"siteDescription",value:t.siteDescription,onChange:s,rows:2,className:"input",placeholder:"A brief description of your site"})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"siteUrl",className:"label",children:["Site URL ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"url",id:"siteUrl",name:"siteUrl",value:t.siteUrl,onChange:s,required:!0,className:"input",placeholder:"https://example.com"})]}),e.jsxs("div",{children:[e.jsxs("label",{htmlFor:"adminEmail",className:"label",children:["Admin Email ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("input",{type:"email",id:"adminEmail",name:"adminEmail",value:t.adminEmail,onChange:s,required:!0,className:"input",placeholder:"[email protected]"}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"This email will be used for system notifications."})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"timezone",className:"label",children:"Timezone"}),e.jsxs("select",{id:"timezone",name:"timezone",value:t.timezone,onChange:s,className:"input",children:[e.jsx("option",{value:"UTC",children:"UTC"}),e.jsx("option",{value:"America/New_York",children:"Eastern Time"}),e.jsx("option",{value:"America/Chicago",children:"Central Time"}),e.jsx("option",{value:"America/Denver",children:"Mountain Time"}),e.jsx("option",{value:"America/Los_Angeles",children:"Pacific Time"}),e.jsx("option",{value:"Europe/London",children:"London"}),e.jsx("option",{value:"Europe/Paris",children:"Paris"}),e.jsx("option",{value:"Asia/Tokyo",children:"Tokyo"})]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"dateFormat",className:"label",children:"Date Format"}),e.jsxs("select",{id:"dateFormat",name:"dateFormat",value:t.dateFormat,onChange:s,className:"input",children:[e.jsx("option",{value:"YYYY-MM-DD",children:"2024-01-15"}),e.jsx("option",{value:"MM/DD/YYYY",children:"01/15/2024"}),e.jsx("option",{value:"DD/MM/YYYY",children:"15/01/2024"})]})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"timeFormat",className:"label",children:"Time Format"}),e.jsxs("select",{id:"timeFormat",name:"timeFormat",value:t.timeFormat,onChange:s,className:"input",children:[e.jsx("option",{value:"24h",children:"24 Hour"}),e.jsx("option",{value:"12h",children:"12 Hour"})]})]})]}),e.jsxs("div",{className:"flex justify-between pt-4",children:[e.jsxs("button",{type:"button",onClick:()=>r({to:"/setup"}),className:"btn-secondary",children:[e.jsx("svg",{className:"w-4 h-4 mr-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 19l-7-7 7-7"})}),"Back"]}),e.jsxs("button",{type:"submit",disabled:o,className:"btn-primary",children:[o?"Saving...":"Continue",e.jsx("svg",{className:"w-4 h-4 ml-2",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:e.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 5l7 7-7 7"})})]})]})]})})}export{y as component};
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.