PageSourceSearch

https://healthserve.ae/assets/AdminSettings-Boge4IiO.js

js healthserve.ae collected 2026-10-04 02:40:11 UTC 2,219 bytes, 1 lines download raw bytes

1import{r,j as e,y as o,aO as a}from"./index-CzMEFmtw.js";import{P as v,a as b,C as x}from"./ui-BklIU2Vp.js";import{J as w}from"./JsonEditor-BjmWdFkX.js";import{P as N}from"./plus-DZqQktxt.js";import{S as k}from"./save-Bu384Y2v.js";function E(){const[u,l]=r.useState([]),[f,c]=r.useState(!0),[n,d]=r.useState("");async function i(){c(!0);const{data:s,error:t}=await o.from("site_settings").select("*").order("key");t&&a.error(t.message),l(s??[]),c(!1)}r.useEffect(()=>{i()},[]);async function g(s){const{error:t}=await o.from("site_settings").update({value:s.value}).eq("key",s.key);if(t)return a.error(t.message);a.success("Saved"),i()}async function p(){if(!n.trim())return a.error("Key required");const{error:s}=await o.from("site_settings").insert({key:n.trim(),value:{}});if(s)return a.error(s.message);d(""),i()}return e.jsxs(v,{children:[e.jsx(b,{title:"Site Settings",description:"Global settings including contact info, countdown fallback, and notification preferences."}),e.jsx(x,{className:"p-4 mb-4",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{placeholder:"new setting key (e.g. social_links)",value:n,onChange:s=>d(s.target.value),className:"flex-1 h-9 px-3 border border-gray-200 rounded-lg text-sm"}),e.jsxs("button",{onClick:p,className:"inline-flex items-center gap-1.5 h-9 px-3 rounded-lg bg-[#F9A01B] text-white text-sm font-semibold",children:[e.jsx(N,{className:"w-4 h-4"})," Add"]})]})}),f&&e.jsx("div",{className:"text-sm text-gray-500",children:"Loading…"}),e.jsx("div",{className:"space-y-4",children:u.map((s,t)=>e.jsxs(x,{className:"p-4",children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{children:[e.jsx("div",{className:"text-sm font-semibold text-gray-900",children:s.key}),e.jsxs("div",{className:"text-xs text-gray-500",children:["Updated ",new Date(s.updated_at).toLocaleString()]})]}),e.jsxs("button",{onClick:()=>g(s),className:"inline-flex items-center gap-1.5 h-9 px-3 rounded-lg bg-[#F9A01B] text-white text-sm font-semibold",children:[e.jsx(k,{className:"w-4 h-4"})," Save"]})]}),e.jsx(w,{value:s.value,rows:8,onChange:h=>l(j=>j.map((m,y)=>y===t?{...m,value:h}:m))})]},s.key))})]})}export{E 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.