import{useCallback as k,useState as m}from"react";import{useMount as n}from"@redocly/theme/core/openapi";function p({tabs:r,defaultTab:e,onChange:t}){const[s,o]=m(e||r[0].key);n(()=>{e&&(o(e),t?.(e))});const c=k(i=>{s!==i.key&&o(i.key),t?.(i.key)},[s,t]);return{activeTab:s,handleTabChange:c}}export{p as useTabsState};
