1import{ct as H,r as a,j as e,L as E,cu as R}from"./main-Bo0oayNO.js";function W(){const{settings:s}=H.useLoaderData(),[r,v]=a.useState(s.headerTitle),[c,j]=a.useState(s.headerSubtitle),[n,N]=a.useState(s.subheading),[o,f]=a.useState(s.ctaHeading),[d,w]=a.useState(s.ctaText),[m,S]=a.useState(s.ctaUrl),[u,k]=a.useState(s.contactEmail),[x,C]=a.useState(s.contactWebsite),[h,U]=a.useState(s.facebookUrl),[g,T]=a.useState(s.youtubeUrl),[b,F]=a.useState(s.privacyPolicyPath),[p,y]=a.useState(!1),[i,l]=a.useState(null),P=async()=>{y(!0),l(null);try{await R({data:{headerTitle:r,headerSubtitle:c,subheading:n,ctaHeading:o,ctaText:d,ctaUrl:m,contactEmail:u,contactWebsite:x,facebookUrl:h,youtubeUrl:g,privacyPolicyPath:b}}),l({type:"success",message:"Template settings saved!"}),setTimeout(()=>l(null),3e3)}catch(t){l({type:"error",message:t instanceof Error?t.message:"Failed to save"})}finally{y(!1)}};return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Newsletter Template"}),e.jsx("p",{className:"text-gray-600",children:"Customize the blog newsletter email template sent to subscribers."})]}),e.jsx(E,{to:"/admin/newsletter",className:"px-4 py-2 text-gray-700 bg-white border border-gray-300 rounded-lg hover:bg-gray-50",children:"Back to Newsletter"})]}),i&&e.jsx("div",{className:`px-4 py-3 rounded-lg text-sm ${i.type==="success"?"bg-green-50 border border-green-200 text-green-700":"bg-red-50 border border-red-200 text-red-700"}`,children:i.message}),e.jsxs("div",{className:"card p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Email Header"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"headerTitle",className:"block text-sm font-medium text-gray-700 mb-1",children:"Header Title"}),e.jsx("input",{type:"text",id:"headerTitle",value:r,onChange:t=>v(t.target.value),className:"input w-full",placeholder:"Down Under Visa"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Main title in the navy header bar"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"headerSubtitle",className:"block text-sm font-medium text-gray-700 mb-1",children:"Header Subtitle"}),e.jsx("input",{type:"text",id:"headerSubtitle",value:c,onChange:t=>j(t.target.value),className:"input w-full",placeholder:"Australian Registered Migration Agents"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Smaller text below the title in the header"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"subheading",className:"block text-sm font-medium text-gray-700 mb-1",children:"Content Subheading"}),e.jsx("input",{type:"text",id:"subheading",value:n,onChange:t=>N(t.target.value),className:"input w-full",placeholder:"Updates from Down Under Visa..."}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Text shown above the featured image, before the post content"})]})]})]}),e.jsxs("div",{className:"card p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Call to Action Banner"}),e.jsx("p",{className:"text-sm text-gray-600 mb-4",children:"Shown below the post content with a button link."}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"ctaHeading",className:"block text-sm font-medium text-gray-700 mb-1",children:"CTA Heading"}),e.jsx("input",{type:"text",id:"ctaHeading",value:o,onChange:t=>f(t.target.value),className:"input w-full",placeholder:"Get a free online visa assessment!"})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"ctaText",className:"block text-sm font-medium text-gray-700 mb-1",children:"Button Text"}),e.jsx("input",{type:"text",id:"ctaText",value:d,onChange:t=>w(t.target.value),className:"input w-full",placeholder:"Start Free Assessment"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"ctaUrl",className:"block text-sm font-medium text-gray-700 mb-1",children:"Button URL"}),e.jsx("input",{type:"url",id:"ctaUrl",value:m,onChange:t=>S(t.target.value),className:"input w-full",placeholder:"https://www.downunderassessments.com"})]})]})]})]}),e.jsxs("div",{className:"card p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Social & Contact Info"}),e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"facebookUrl",className:"block text-sm font-medium text-gray-700 mb-1",children:"Facebook URL"}),e.jsx("input",{type:"url",id:"facebookUrl",value:h,onChange:t=>U(t.target.value),className:"input w-full",placeholder:"https://www.facebook.com/..."})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"youtubeUrl",className:"block text-sm font-medium text-gray-700 mb-1",children:"YouTube URL"}),e.jsx("input",{type:"url",id:"youtubeUrl",value:g,onChange:t=>T(t.target.value),className:"input w-full",placeholder:"https://www.youtube.com/..."})]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{children:[e.jsx("label",{htmlFor:"contactEmail",className:"block text-sm font-medium text-gray-700 mb-1",children:"Contact Email"}
1),e.jsx("input",{type:"email",id:"contactEmail",value:u,onChange:t=>k(t.target.value),className:"input w-full",placeholder:"[email protected]"})]}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"contactWebsite",className:"block text-sm font-medium text-gray-700 mb-1",children:"Website Display Name"}),e.jsx("input",{type:"text",id:"contactWebsite",value:x,onChange:t=>C(t.target.value),className:"input w-full",placeholder:"downundervisa.com"})]})]})]})]}),e.jsxs("div",{className:"card p-6",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Footer"}),e.jsxs("div",{children:[e.jsx("label",{htmlFor:"privacyPolicyPath",className:"block text-sm font-medium text-gray-700 mb-1",children:"Privacy Policy Path"}),e.jsx("input",{type:"text",id:"privacyPolicyPath",value:b,onChange:t=>F(t.target.value),className:"input w-full",placeholder:"/privacy-policy"}),e.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Path on your site (e.g. /privacy-policy). Unsubscribe link is auto-generated per subscriber."})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:P,disabled:p,className:"btn-primary",children:p?"Saving...":"Save Template Settings"})})]})}export{W 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.