1import{u as m,A as x,r as f,j as e,P as u}from"./index-D1aKNduO.js";import{P as h}from"./PageBreadCrumb-BHH2LLyg.js";import"./firebase-DGovvYsO.js";const j=()=>{const{t}=m(),{settings:s,loading:l,error:i,updateSetting:o}=x(),[a,n]=f.useState(!1),d=async(r,c)=>{if(s)try{n(!0),await o(r,c),console.log("Setting saved successfully")}catch(g){console.error("Error updating setting:",g)}finally{n(!1)}};return l?e.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:e.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-brand-500"})}):i?e.jsx("div",{className:"flex items-center justify-center min-h-[400px]",children:e.jsxs("div",{className:"text-red-500 text-center",children:[e.jsx("p",{className:"text-lg font-medium",children:t("admin.settings.loadError","Error loading settings")}),e.jsx("p",{className:"text-sm",children:i})]})}):e.jsxs(e.Fragment,{children:[e.jsx(u,{title:t("admin.settings.title","Platform Settings"),description:t("admin.settings.description","Manage platform-wide settings and features")}),e.jsx(h,{pageTitle:t("admin.settings.title","Platform Settings")}),e.jsx("div",{className:"max-w-4xl mx-auto",children:e.jsxs("div",{className:"bg-white dark:bg-gray-900 rounded-lg shadow-sm border border-gray-200 dark:border-gray-800",children:[e.jsxs("div",{className:"p-6 border-b border-gray-200 dark:border-gray-800",children:[e.jsx("h1",{className:"text-2xl font-bold text-gray-900 dark:text-white",children:t("admin.settings.title","Platform Settings")}),e.jsx("p",{className:"text-gray-600 dark:text-gray-400 mt-2",children:t("admin.settings.subtitle","Configure platform-wide features and functionality")})]}),e.jsxs("div",{className:"p-6 space-y-6",children:[e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:t("admin.settings.questions.title","Question Features")}),e.jsx("div",{className:"space-y-4",children:e.jsxs("div",{className:"flex items-center justify-between p-4 bg-gray-50 dark:bg-gray-800 rounded-lg",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-base font-medium text-gray-900 dark:text-white",children:t("admin.settings.questions.boost.title","Question Boost")}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:t("admin.settings.questions.boost.description","Allow question creators to boost their questions for increased visibility")})]}),e.jsx("div",{className:"ml-4",children:e.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:s?.questionBoostEnabled??!0,onChange:r=>d("questionBoostEnabled",r.target.checked),disabled:a,className:"sr-only peer"}),e.jsx("div",{className:"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-brand-300 dark:peer-focus:ring-brand-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-brand-600"})]})})]})})]}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-lg font-semibold text-gray-900 dark:text-white",children:t("admin.settings.ads.title","Monetization")}),e.jsxs("div",{className:"flex items-center justify-between p-4 bg-gray-50 dark:bg-gray-800 rounded-lg",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"text-base font-medium text-gray-900 dark:text-white",children:t("admin.settings.ads.questionsToggle.title","Questions page ads")}),e.jsx("p",{className:"text-sm text-gray-600 dark:text-gray-400 mt-1",children:t("admin.settings.ads.questionsToggle.description","Show configured Google AdSense slots in the Questions experience when Ads Setup has valid credentials.")}),e.jsx("p",{className:"text-xs text-gray-500 dark:text-gray-500 mt-2",children:s?.adsensePublisherId&&s?.adsenseSlotId?t("admin.settings.ads.questionsToggle.configured","AdSense IDs detected. Ads will render when enabled."):t("admin.settings.ads.questionsToggle.missing","AdSe
1nse IDs missing. Configure them in Admin â Ads Setup before enabling.")})]}),e.jsx("div",{className:"ml-4",children:e.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[e.jsx("input",{type:"checkbox",checked:s?.adsEnabled??!1,onChange:r=>d("adsEnabled",r.target.checked),disabled:a,className:"sr-only peer"}),e.jsx("div",{className:"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-brand-300 dark:peer-focus:ring-brand-800 rounded-full peer dark:bg-gray-700 peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all dark:border-gray-600 peer-checked:bg-brand-600"})]})})]})]})]}),a&&e.jsx("div",{className:"px-6 py-3 bg-blue-50 dark:bg-blue-900/20 border-t border-gray-200 dark:border-gray-800",children:e.jsxs("div",{className:"flex items-center",children:[e.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-brand-500 mr-2"}),e.jsx("span",{className:"text-sm text-blue-600 dark:text-blue-400",children:t("admin.settings.saving","Saving...")})]})})]})})]})};export{j 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.