1import{d as h,r as a,s as l,j as s,e as v,f as j,h as S,i as g,k as w,B as y}from"./index-BBwi5kqS.js";import{I as b}from"./input-JLfvfLkB.js";import{L as C}from"./label-YaqFE0Nc.js";import{L as c}from"./loader-circle-DmhKP_P8.js";import{S as N}from"./save-oQeRedX_.js";const _=[["name","Praxisname"],["owner","Inhaberin"],["street","StraÃe"],["zip","PLZ"],["city","Stadt"],["phone","Telefon"],["email","E-Mail"],["website","Website"],["tax_number","Steuer-Nr."],["vat_id","USt-IdNr. (optional)"]];function z(){const{toast:r}=h(),[d,u]=a.useState(!0),[i,n]=a.useState(!1),[o,m]=a.useState({name:"",street:"",zip:"",city:"",phone:"",email:"",owner:"",tax_number:"",vat_id:"",website:""});a.useEffect(()=>{l.from("site_settings").select("value").eq("key","praxis_info").single().then(({data:e})=>{e!=null&&e.value&&m(t=>({...t,...e.value})),u(!1)})},[]);const p=async()=>{n(!0);const{error:e}=await l.from("site_settings").upsert({key:"praxis_info",value:o,updated_at:new Date().toISOString()});n(!1),r(e?{title:"Fehler",description:e.message,variant:"destructive"}:{title:"Gespeichert",description:"Praxis-Informationen wurden aktualisiert."})};return d?s.jsx("div",{className:"flex justify-center py-12",children:s.jsx(c,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):s.jsxs(v,{children:[s.jsxs(j,{children:[s.jsx(S,{children:"Praxis-Informationen"}),s.jsx(g,{children:"Name, Adresse und Kontaktdaten der Praxis"})]}),s.jsxs(w,{className:"space-y-4",children:[_.map(([e,t])=>s.jsxs("div",{className:"space-y-1.5",children:[s.jsx(C,{htmlFor:e,children:t}),s.jsx(b,{id:e,value:o[e]??"",onChange:x=>m(f=>({...f,[e]:x.target.value}))})]},e)),s.jsxs(y,{variant:"admin-primary",size:"admin-sm",onClick:p,disabled:i,children:[i?s.jsx(c,{className:"h-4 w-4 animate-spin mr-2"}):s.jsx(N,{className:"h-4 w-4 mr-2"}),"Speichern"]})]})]})}export{z 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.