import n from"react";import{LayoutVariant as o}from"@redocly/config";import{usePageSharedData as a}from"../../providers/page-data/hooks";function S(){const{document:s}=a("AsyncApiDefinition")||{},{definition:i,options:t={}}=a("openAPIDocsStore")||{},c=i&&t||s,[e,u]=n.useState(t.layout||o.THREE_PANEL),[r,l]=n.useState(!1);function p(){u(e===o.STACKED?o.THREE_PANEL:o.STACKED)}function C(){l(f=>!f)}return{onChangeViewClick:p,onChangeCollapseSidebarClick:C,showChangeLayoutButton:t.showChangeLayoutButton||!0,layout:e,collapsedSidebar:r,isApiDocs:c}}export{S as useActions};
