"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.useTabsState=void 0;const react_1=require("react"),theme_1=require("@redocly/theme");function useTabsState({tabs:e,defaultTab:t,onChange:a}){const[s,u]=(0,react_1.useState)(t||e[0].key);(0,theme_1.useMount)((()=>{t&&(u(t),null==a||a(t))}));const r=(0,react_1.useCallback)((e=>{s!==e.key&&u(e.key),null==a||a(e.key)}),[s,a]);return{activeTab:s,handleTabChange:r}}exports.useTabsState=useTabsState;
//# sourceMappingURL=useTabsState.js.map