import{a as g,D as h,u as d,r as p,s as m,j as t,dg as f,E as n}from"./index-KAtljJVt.js";import{I as j}from"./InfoAlert-BDXiwj6e.js";import{S as c}from"./SettingsList-B3K-wAVh.js";import"./envs-CSqIi4cL.js";import"./CheckboxField-DhE3iyQ3.js";import"./InputField-D4fq1Htu.js";import"./NumberField-CpqFpk71.js";import"./SelectField-wRS87yKs.js";const o=({isActive:e})=>e?"tab tab-active":"tab";function q({sourceIdx:e,tab:i}){const r=g(h(s=>s.bridgeInfo[e])),{t:a}=d(["settings","common"]),l=p.useCallback(async s=>{i==="main"?await m(e,"bridge/request/options",{options:s}):await m(e,"bridge/request/options",{options:{[i]:s}})},[e,i]);return t.jsxs(t.Fragment,{children:[t.jsx(j,{children:t.jsx("a",{href:f,target:"_blank",rel:"noreferrer",className:"link link-hover",children:a(s=>s.read_the_docs_info,{ns:"common"})})}),t.jsxs("div",{className:"tabs tabs-border",children:[t.jsx(n,{to:`/settings/${e}/settings/main`,className:o,children:a(s=>s.main)}),t.jsx(n,{to:`/settings/${e}/settings/frontend`,className:o,children:a(s=>s.frontend)}),t.jsx(n,{to:`/settings/${e}/settings/mqtt`,className:o,children:a(s=>s.mqtt)}),t.jsx(n,{to:`/settings/${e}/settings/serial`,className:o,children:a(s=>s.serial)}),t.jsx(n,{to:`/settings/${e}/settings/availability`,className:o,children:a(s=>s.availability)}),t.jsx(n,{to:`/settings/${e}/settings/ota`,className:o,children:a(s=>s.ota)}),t.jsx(n,{to:`/settings/${e}/settings/advanced`,className:o,children:a(s=>s.advanced)}),t.jsx(n,{to:`/settings/${e}/settings/homeassistant`,className:o,children:a(s=>s.homeassistant)}),t.jsx("div",{className:"tab-content block h-full bg-base-100 p-3",children:i==="main"?t.jsx(c,{schema:r.config_schema,data:r.config,set:l,rootOnly:!0,namespace:""}):r.config_schema.properties[i]?t.jsx(c,{schema:r.config_schema.properties[i],data:r.config[i],set:l,namespace:i}):null})]})]})}export{q as default};
