import{a as g,I as h,u as d,r as p,s as m,j as t,dA as f,J as i}from"./index-CE-9RlbR.js";import{I as j}from"./InfoAlert-AzL4ZLp4.js";import{S as c}from"./SettingsList-DXaUDCbO.js";import"./envs-CRUy-_iG.js";import"./CheckboxField-BPvsXluL.js";import"./InputField-DRmYNLGX.js";import"./NumberField-XGSCkVuy.js";import"./SelectField-BPXpeItQ.js";const n=({isActive:e})=>e?"tab tab-active":"tab";function A({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{A as default};
