(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[662],{1735:(e,t,s)=>{Promise.resolve().then(s.bind(s,8171))},8171:(e,t,s)=>{"use strict";s.d(t,{SettingsPage:()=>n});var a=s(8111),r=s(5271),l=s(8719);function n(){let{config:e,setConfig:t,client:s}=(0,l.U)(),[n,o]=(0,r.useState)(e.apiUrl),[i,d]=(0,r.useState)(e.apiToken),[c,u]=(0,r.useState)("idle"),[x,b]=(0,r.useState)(!1);(0,r.useEffect)(()=>{o(e.apiUrl),d(e.apiToken)},[e]);let g=async()=>{u("testing");try{await s.fetchHealth(),u("ok")}catch(e){u("error")}setTimeout(()=>u("idle"),3e3)};return(0,a.jsxs)("div",{className:"p-6 max-w-2xl mx-auto",children:[(0,a.jsx)("h1",{className:"text-xl font-semibold text-gray-200 mb-6",children:"Einstellungen"}),(0,a.jsxs)("div",{className:"bg-[#111111] border border-[#1f1f1f] rounded-xl p-6 space-y-5",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm text-gray-400 mb-1",children:"Alfred API URL"}),(0,a.jsx)("input",{type:"text",value:n,onChange:e=>o(e.target.value),placeholder:"http://localhost:3420",className:"w-full bg-[#0d0d0d] border border-[#2a2a2a] rounded-lg px-4 py-2.5 text-sm text-gray-200 focus:outline-none focus:border-blue-500"})]}),(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"block text-sm text-gray-400 mb-1",children:"API Token"}),(0,a.jsx)("input",{type:"password",value:i,onChange:e=>d(e.target.value),placeholder:"Optional — Bearer Token",className:"w-full bg-[#0d0d0d] border border-[#2a2a2a] rounded-lg px-4 py-2.5 text-sm text-gray-200 focus:outline-none focus:border-blue-500"})]}),(0,a.jsxs)("div",{className:"flex gap-3",children:[(0,a.jsx)("button",{onClick:()=>{t({apiUrl:n,apiToken:i}),b(!0),setTimeout(()=>b(!1),2e3)},className:"bg-blue-600 hover:bg-blue-700 text-white rounded-lg px-5 py-2.5 text-sm font-medium transition-colors",children:x?"Gespeichert!":"Speichern"}),(0,a.jsx)("button",{onClick:g,disabled:"testing"===c,className:"bg-[#1a1a1a] border border-[#2a2a2a] hover:bg-[#222] text-gray-300 rounded-lg px-5 py-2.5 text-sm transition-colors disabled:opacity-50",children:"testing"===c?"Teste...":"ok"===c?"Verbunden!":"error"===c?"Fehler!":"Verbindung testen"})]})]}),(0,a.jsx)("p",{className:"text-xs text-gray-600 mt-4",children:"Konfiguration wird in deinem Browser (localStorage) gespeichert. Token wird nie an Dritte gesendet."})]})}}},e=>{e.O(0,[719,814,743,358],()=>e(e.s=1735)),_N_E=e.O()}]);