UNPKG

zigbee2mqtt-windfront

Version:

[![Version](https://img.shields.io/npm/v/zigbee2mqtt-windfront.svg)](https://npmjs.org/package/zigbee2mqtt-windfront) [![CI](https://github.com/Nerivec/zigbee2mqtt-windfront/actions/workflows/ci.yml/badge.svg)](https://github.com/Nerivec/zigbee2mqtt-windf

3 lines (2 loc) 3.43 kB
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./About-CBXe3LF9.js","./index-Cg_dwqpD.js","./envs-CSqIi4cL.js","./index-UjZc6d-V.css","./snakeCase-CrKq36vi.js","./_createCompounder-Dcznv9Az.js","./isArray-uIIfUpwr.js","./Health-DlIcPYjL.js","./useTable-B3JMT6Iq.js","./DebouncedInput-E4d1IUlA.js","./DeviceImage-CHwoOcls.js","./index-BbB5QEu8.js","./InfoAlert-B2RwtOeQ.js","./Table-FUtHXzGb.js","./format-BHlbVbae.js","./Settings-BAzvJnW3.js","./SettingsList-CDX9ME9V.js","./CheckboxField-D0wHGmUZ.js","./InputField-D9KJc30P.js","./NumberField-Bz4sSMOV.js","./SelectField-dfeWrxvV.js","./Tools-p7CNLqZ_.js","./Bridge-CpN8YQde.js","./Json-BZbhIKAk.js","./DevConsole-DPEtlBix.js","./TextareaField-LpcEEomy.js"])))=>i.map(i=>d[i]); import{b,u as v,h as f,i as h,r as o,m as j,a7 as x,q as T,a8 as E,a9 as N,B as $,j as s,l as _,F as y,N as A,M as P,A as w,S,_ as l}from"./index-Cg_dwqpD.js";import"./envs-CSqIi4cL.js";const z=o.lazy(async()=>await l(()=>import("./About-CBXe3LF9.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url)),L=o.lazy(async()=>await l(()=>import("./Health-DlIcPYjL.js"),__vite__mapDeps([7,1,2,3,8,9,10,11,12,13,14]),import.meta.url)),D=o.lazy(async()=>await l(()=>import("./Settings-BAzvJnW3.js"),__vite__mapDeps([15,1,2,3,12,16,17,18,19,20]),import.meta.url)),R=o.lazy(async()=>await l(()=>import("./Tools-p7CNLqZ_.js"),__vite__mapDeps([21,1,2,3,18,11]),import.meta.url)),V=o.lazy(async()=>await l(()=>import("./Bridge-CpN8YQde.js"),__vite__mapDeps([22,1,2,3,23]),import.meta.url)),O=o.lazy(async()=>await l(()=>import("./DevConsole-DPEtlBix.js"),__vite__mapDeps([24,1,2,3,18,20,25,12]),import.meta.url));function C(t,n,a){switch(n){case"about":return s.jsx(z,{sourceIdx:t},t);case"health":return s.jsx(L,{sourceIdx:t},t);case"settings":return s.jsx(D,{sourceIdx:t,tab:a??"main"},t);case"tools":return s.jsx(R,{sourceIdx:t},t);case"bridge":return s.jsx(V,{sourceIdx:t},t);case"dev-console":return s.jsx(O,{sourceIdx:t,tab:a??"mqtt"},t)}}const g=({isActive:t})=>t?"menu-active":void 0;function q(){const{t}=b("settings"),n=v(),{sourceIdx:a,tab:i,subTab:r}=f(),[d,c]=h(a);o.useEffect(()=>{!a||!c?n(`/settings/0/${i||"about"}`,{replace:!0}):i?r||(i==="settings"?n(`/settings/${a}/settings/main`,{replace:!0}):i==="dev-console"&&n(`/settings/${a}/dev-console/mqtt`,{replace:!0})):n(`/settings/${a}/about`,{replace:!0})},[a,c,i,r,n]);const p=o.useMemo(()=>[{to:`/settings/${a}/about`,icon:j,title:t(e=>e.about)},{to:`/settings/${a}/health`,icon:x,title:t(e=>e.health)},{to:`/settings/${a}/settings`,icon:T,title:t(e=>e.settings)},{to:`/settings/${a}/tools`,icon:E,title:t(e=>e.tools)},{to:`/settings/${a}/bridge`,icon:N,title:t(e=>e.bridge)},{to:`/settings/${a}/dev-console`,icon:$,title:t(e=>e.dev_console)}],[a,t]),m=s.jsx("div",{className:"menu menu-horizontal flex-1",children:p.map(e=>s.jsx("li",{className:"tooltip tooltip-bottom","data-tip":e.title,children:s.jsxs(_,{to:e.to,className:g,children:[s.jsx(y,{icon:e.icon,size:"lg"}),s.jsx("span",{className:"hidden lg:inline",children:e.title})]})},e.to))});return s.jsxs(s.Fragment,{children:[s.jsx(A,{children:P?s.jsxs("div",{className:"flex-1 flex flex-col",children:[s.jsx("div",{className:"menu menu-horizontal flex-1 pb-0",children:w.map((e,u)=>s.jsx("li",{children:s.jsx(_,{to:`/settings/${u}/${i||"about"}${r?`/${r}`:""}`,className:g,children:s.jsx(S,{idx:u,alwaysShowName:!0})})},e))}),m]}):m}),i&&C(d,i,r)]})}export{q as default};