1import{r,j as e}from"./react-vendor-DDlTsOEd.js";import{A as S,c as w}from"./AdminLayout-B0DIBAYd.js";import{d as f}from"./index-BBAL-XO_.js";import{S as _}from"./skeleton-DBoY5sj-.js";import{C as y}from"./check-IICmzcl3.js";import{S as b}from"./save-BHG8fsRQ.js";import"./megaphone-c2Ccoqv-.js";import"./clipboard-check-B-VFQxDc.js";import"./database-CfQ3DoFp.js";import"./tag-finmna5A.js";import"./credit-card-jC5ykv7d.js";const j={academy_name:"MSAstroacademy",contact_email:"[email protected]",contact_phone:"",support_email:"[email protected]",website_url:"",currency:"INR",timezone:"Asia/Kolkata",certificate_signatory_name:"Mrs Madhavi Sharma",certificate_signatory_title:"Founder & Lead Instructor"};function C({label:n,value:d,loading:l,onChange:c,type:t="text",placeholder:o=""}){return e.jsxs("div",{children:[e.jsx("label",{className:"block text-xs font-medium text-gray-900 mb-1.5",children:n}),l?e.jsx(_,{className:"h-9 w-full bg-gray-100 rounded-lg"}):e.jsx("input",{type:t,value:d,onChange:c,placeholder:o,className:"w-full border border-gray-200 rounded-lg px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-indigo-200"})]})}function P(){const[n,d]=r.useState({...j}),[l,c]=r.useState(!0),[t,o]=r.useState(!1),[g,m]=r.useState(!1),[h,u]=r.useState(null);r.useEffect(()=>{f.get("/admin/settings").then(a=>{const i=a.data??{};d({...j,...i})}).finally(()=>c(!1))},[]);const v=a=>i=>{d(x=>({...x,[a]:i.target.value}))},p=async()=>{o(!0),m(!1),u(null);try{await f.put("/admin/settings",n),m(!0),setTimeout(()=>m(!1),3e3)}catch(a){u(a instanceof Error?a.message:"Could not save settings")}finally{o(!1)}},s=(a,i,x,N)=>e.jsx(C,{label:a,value:n[i],loading:l,onChange:v(i),type:x,placeholder:N});return e.jsx(S,{children:e.jsxs("div",{className:"space-y-6 max-w-3xl",children:[e.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900",children:"Settings"}),e.jsx("p",{className:"text-sm text-gray-900 mt-0.5",children:"Configure your academy's information and preferences."})]}),e.jsx("button",{onClick:p,disabled:t,className:"flex items-center gap-2 bg-indigo-600 hover:bg-indigo-700 disabled:opacity-50 text-white text-sm font-medium px-4 py-2 rounded-lg transition-colors",children:g?e.jsxs(e.Fragment,{children:[e.jsx(y,{size:15})," Saved!"]}):t?"Savingâ¦":e.jsxs(e.Fragment,{children:[e.jsx(b,{size:15})," Save Changes"]})})]}),h&&e.jsx("div",{className:"bg-red-50 border border-red-200 text-red-700 text-sm rounded-lg px-4 py-2.5",children:h}),e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 space-y-5",children:[e.jsxs("h2",{className:"font-semibold text-gray-900 flex items-center gap-2",children:[e.jsx(w,{size:16,className:"text-gray-900"})," Academy Information"]}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s("Academy Name","academy_name"),s("Contact Email","contact_email","email"),s("Contact Phone","contact_phone",void 0,"+91 98765 43210"),s("Support Email","support_email","email"),s("Website URL","website_url","url","https://msastroacademy.com")]})]}),e.jsxs("div",{className:"rounded-xl border border-amber-200 bg-amber-50/60 p-6",children:[e.jsx("h2",{className:"font-semibold text-gray-900",children:"Social links and the tagline are edited in code"}),e.jsxs("p",{className:"mt-2 text-sm leading-relaxed text-gray-900",children:["The footer and contact page read them from"," ",e.jsx("code",{className:"rounded bg-white px-1 py-0.5 text-xs",children:"src/data/academy.ts"}),", and each profile is also listed as ",e.jsx("code",{className:"rounded bg-white px-1 py-0.5 text-xs",children:"sameAs"})," in the site's structured data â which sits in ",e.jsx("code",{className:"rounded bg-white px-1 py-0.5 text-xs",children:"index.html"})," and is written when the site is built, so it cannot be filled in from the database."]}),e.jsx("p",{className:"mt-3 text-xs leading-relaxed text-gray-900",children:"This card used to hold Facebook, Instagram and YouTube fields, and Academy Information held a Tagline. Nothing read any of them â the footer showed no social links at all while all three sat saved in the database. Removed on 3 August 2026, when the real links went live."})]}),e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 space-y-5",children:[e.jsx("h2",{className:"font-semibold text-gray-900",children:"Certificate Settings"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s("Signatory Name","certificate_signatory_name"),s("Signatory Title","certificate_signatory_title")]})]}),e.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 space-y-5",children:[e.jsx("h2",{className:"font-semibold text-gray-900",children:"Regional"}),e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[s("Currency","currency",void 0,"INR"),s("Timezone","timezone",void 0,"Asia/Kolkata")]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsx("button",{onClick:p,disabled:t,className:"flex items-center gap-2 bg-indigo-600 hover:bg-indigo-700 disabled:opacity-50 text-white text-sm font-medium px-5 py-2.5 rounded-lg transition-colors",children:g?e.jsxs(e.Fragment,{children:[e.jsx(y,{size:15})," Saved!"]}):t?"Savingâ¦":e.jsxs(e.Fragment,{children:[e.jsx(b,{size:15})," Save Changes"]})})})]})})}export{P 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.