import{dB as g,dF as h,dG as d,dq as p,dx as m,dm as t,C as f,S as i}from"./index-D_pphaE2.js";import{I as j}from"./InfoAlert-BjFk5zJ1.js";import{S as c}from"./SettingsList-CwQILOJa.js";import"./envs-CRUy-_iG.js";import"./CheckboxField-Bp87NFVr.js";import"./InputField-B0SBdaHi.js";import"./NumberField-Dq3HyXeU.js";import"./SelectField-J0vaqEIK.js";const n=({isActive:e})=>e?"tab tab-active":"tab";function q({sourceIdx:e,tab:l}){const o=g(h(s=>s.bridgeInfo[e])),{t:a}=d(["settings","common"]),r=p.useCallback(async s=>{l==="main"?await m(e,"bridge/request/options",{options:s}):await m(e,"bridge/request/options",{options:{[l]:s}})},[e,l]);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(i,{to:`/settings/${e}/settings/main`,className:n,children:a(s=>s.main)}),t.jsx(i,{to:`/settings/${e}/settings/frontend`,className:n,children:a(s=>s.frontend)}),t.jsx(i,{to:`/settings/${e}/settings/mqtt`,className:n,children:a(s=>s.mqtt)}),t.jsx(i,{to:`/settings/${e}/settings/serial`,className:n,children:a(s=>s.serial)}),t.jsx(i,{to:`/settings/${e}/settings/availability`,className:n,children:a(s=>s.availability)}),t.jsx(i,{to:`/settings/${e}/settings/ota`,className:n,children:a(s=>s.ota)}),t.jsx(i,{to:`/settings/${e}/settings/advanced`,className:n,children:a(s=>s.advanced)}),t.jsx(i,{to:`/settings/${e}/settings/homeassistant`,className:n,children:a(s=>s.homeassistant)}),t.jsx(i,{to:`/settings/${e}/settings/health`,className:n,children:a(s=>s.health)}),t.jsx("div",{className:"tab-content block h-full bg-base-100 p-3",children:l==="main"?t.jsx(c,{schema:o.config_schema,data:o.config,set:r,rootOnly:!0,namespace:""}):o.config_schema.properties[l]?t.jsx(c,{schema:o.config_schema.properties[l],data:o.config[l],set:r,namespace:l}):null})]})]})}export{q as default};
