PageSourceSearch

https://www.gs1nz.org/assets/IntegrationStatus-BYWCXNMa.js

js gs1nz.org collected 2026-10-02 07:43:35 UTC 2,881 bytes, 1 lines download raw bytes

1import{r as n,j as e}from"./react-vendor-DgF5BvPh.js";import{X as p,B as f,w as j,Z as g,v}from"./index-DQrNnQ_p.js";import{C as N,a as y,b as C,d as b}from"./card-BYYhIoy9.js";import{S as w}from"./shield-check-BMaV9jYF.js";import{C as k}from"./circle-check-Ck8bL7Oz.js";import{C as S}from"./circle-minus-Dd2C1bfB.js";import"./ui-vendor-DLQD4Y5c.js";import"./router-CYXz2GUs.js";function x({present:r,label:i}){return e.jsxs("span",{className:"inline-flex items-center gap-1.5 text-sm",children:[r?e.jsx(k,{className:"h-4 w-4 text-green-600"}):e.jsx(S,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("span",{className:r?"":"text-muted-foreground",children:i})]})}function R(){const{isAdmin:r,loading:i}=p(),[a,u]=n.useState(null),[l,d]=n.useState(!1),[c,o]=n.useState(null),m=async()=>{d(!0),o(null);const{data:t,error:s}=await v.functions.invoke("integration-status",{body:{}});s?o(s.message):u(t),d(!1)};return n.useEffect(()=>{r&&m()},[r]),i?null:r?e.jsxs("div",{className:"container mx-auto max-w-4xl space-y-6 px-4 py-10",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"Integration keys"}),e.jsx("p",{className:"max-w-2xl text-muted-foreground",children:"Which credentials each integration will use on this site. Values are never shown — only whether a key has been saved. The site address decides the environment: anything that is not a live address is treated as test."})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(f,{onClick:m,disabled:l,children:[l&&e.jsx(j,{className:"mr-2 h-4 w-4 animate-spin"}),"Refresh"]}),a&&e.jsxs(g,{variant:a.environment==="prod"?"default":"secondary",children:[a.environment==="prod"?"Live environment":"Test environment",a.host?` — ${a.host}`:""]})]}),c&&e.jsx("p",{className:"text-destructive",children:c}),a==null?void 0:a.integrations.map(t=>e.jsxs(N,{children:[e.jsx(y,{children:e.jsxs(C,{className:"flex items-center gap-2 text-lg",children:[e.jsx(w,{className:"h-5 w-5 text-muted-foreground"}),t.label]})}),e.jsxs(b,{className:"space-y-4",children:[e.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:Object.entries(t.settings).map(([s,h])=>e.jsxs("div",{className:"text-sm",children:[e.jsxs("span",{className:"text-muted-foreground",children:[s,": "]}),e.jsx("span",{className:"break-all font-medium",children:h})]},s))}),e.jsx("div",{className:"space-y-2 rounded-md border p-3",children:t.secrets.map(s=>e.jsxs("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-1",children:[e.jsx(x,{present:s.livePresent,label:`${s.liveName} (live)`}),e.jsx(x,{present:s.testPresent,label:`${s.testName} (test)`})]},s.liveName))}),t.note&&e.jsx("p",{className:"text-sm text-muted-foreground",children:t.note})]})]},t.key))]}):e.jsx("div",{className:"p-8 text-muted-foreground",children:"Admin access required."})}export{R 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.