import{useCurrentDevice as e}from"@gem-sdk/core";import{useState as t}from"react";import{useGetProductId as o}from"../../hooks/useGetProductId.js";import{useTabInteraction as r}from"./useTabInteraction.js";let i=(i,m)=>{let{activeKey:d}=i??{},l=e(),[p,s]=t(!d||d<0||d>=(i?.childItem??[]).length?0:d),{refContainer:a,productID:c}=o(),{dispatchEventTabActive:n}=r({activeKey:d||1,setActiveKey:s,activeTab:p,refContainer:a,componentUid:m?.uid||""});return i&&!i?.labelWidth&&(i.labelWidth={desktop:"200px"}),{currentDevice:l,productID:c,dispatchEventTabActive:n,activeTab:p,setActiveKey:s,refContainer:a}};export{i as useTab};
