import{a as g,E as h,u as d,r as p,s as m,j as t,dg as f,G as n}from"./index-ClCsMWbS.js";import{I as j}from"./InfoAlert-DaX4x_1T.js";import{S as c}from"./SettingsList-B14Dp6bl.js";import"./envs-CSqIi4cL.js";import"./CheckboxField-BxtT6ttj.js";import"./InputField-CqTVHKf8.js";import"./NumberField-Bv80Uoa9.js";import"./SelectField-WiB6Edsu.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};
