import{jsx as c}from"react/jsx-runtime";import{useEffect as a}from"react";import{useAtom as l,useAtomValue as f}from"jotai";import{layoutAtom as S,collapsedSidebarAtom as b}from"../jotai/app.js";import{globalStoreAtom as n}from"../jotai/store.js";function W(s){return({portalOptions:o,...i})=>{const[u,e]=l(S),[m,t]=l(b),{options:d,parser:r}=f(n);return a(()=>{o?.layout&&e(o.layout)},[o?.layout,e]),a(()=>{typeof o?.collapsedSidebar=="boolean"&&t(o.collapsedSidebar)},[o?.collapsedSidebar,t]),r?c(s,{...i,options:d,layout:u,collapsedSidebar:m,parser:r}):null}}export{W as withStore};
