(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8405],{3927:function(e,t,s){Promise.resolve().then(s.bind(s,7771))},7771:function(e,t,s){"use strict";s.d(t,{StatusDashboard:function(){return l}});var a=s(7437),r=s(2265);function n(e){return"connected"===e?"var(--success)":"degraded"===e?"var(--warning)":"var(--error)"}function c(e){return"connected"===e?"Operational":"degraded"===e?"Degraded":"mock"===e?"Mock Mode":e}function l(){let[e,t]=(0,r.useState)({kind:"loading"}),s=(0,r.useCallback)(async()=>{try{let e=await fetch("".concat("https://api.zoff.app","/health"));if(!e.ok)throw Error("HTTP ".concat(e.status));let s=await e.json();t({kind:"ok",data:s,checkedAt:new Date})}catch(e){t({kind:"error",message:e instanceof Error?e.message:"Unknown error",checkedAt:new Date})}},[]);return(0,r.useEffect)(()=>{s();let e=setInterval(s,3e4);return()=>clearInterval(e)},[s]),(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("h1",{className:"font-numbers text-3xl sm:text-4xl font-bold text-[var(--text-primary)] mb-3",children:"System Status"}),(0,a.jsx)("p",{className:"text-[var(--text-secondary)] mb-10",children:"Live health check of the Zoff Wallet API."}),(0,a.jsx)("div",{className:"glass-1 rounded-xl border border-[var(--glass-border-bottom)] p-6 mb-6",children:"loading"===e.kind?(0,a.jsxs)("div",{className:"flex items-center gap-3 text-[var(--text-tertiary)]",children:[(0,a.jsx)("span",{className:"w-3 h-3 rounded-full bg-[var(--text-disabled)] animate-pulse"}),"Checking…"]}):"error"===e.kind?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"w-3 h-3 rounded-full",style:{background:"var(--error)"}}),(0,a.jsx)("span",{className:"font-numbers font-semibold text-[var(--text-primary)]",children:"Unreachable"})]}),(0,a.jsx)("button",{onClick:s,className:"text-xs text-[var(--orange)] hover:text-[var(--orange-l)] transition-colors",children:"Refresh"})]}),(0,a.jsxs)("div",{className:"text-sm text-[var(--text-tertiary)]",children:["Could not reach the API: ",e.message]})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex items-center justify-between mb-6",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("span",{className:"w-3 h-3 rounded-full",style:{background:n(e.data.canton)}}),(0,a.jsxs)("span",{className:"font-numbers font-semibold text-[var(--text-primary)]",children:["All Systems ",c(e.data.canton)]})]}),(0,a.jsx)("button",{onClick:s,className:"text-xs text-[var(--orange)] hover:text-[var(--orange-l)] transition-colors",children:"Refresh"})]}),(0,a.jsxs)("div",{className:"grid gap-4 sm:grid-cols-2",children:[(0,a.jsx)(o,{name:"API Server",status:"ok"===e.data.status?"connected":"error"}),(0,a.jsx)(o,{name:"Canton Ledger",status:e.data.canton})]})]})}),"loading"!==e.kind&&(0,a.jsxs)("p",{className:"text-xs text-[var(--text-disabled)]",children:["Last checked ",e.checkedAt.toLocaleTimeString()," \xb7 Refreshes every 30s"]})]})}function o(e){let{name:t,status:s}=e;return(0,a.jsxs)("div",{className:"flex items-center justify-between rounded-lg bg-[var(--bg-elevated)] border border-[var(--glass-border-bottom)] px-4 py-3",children:[(0,a.jsx)("span",{className:"text-sm text-[var(--text-secondary)]",children:t}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"w-2 h-2 rounded-full",style:{background:n(s)}}),(0,a.jsx)("span",{className:"text-xs font-mono text-[var(--text-tertiary)]",children:c(s)})]})]})}}},function(e){e.O(0,[2971,2117,1744],function(){return e(e.s=3927)}),_N_E=e.O()}]);