import{F as I,b as T,eh as C,r as M,f as S,i as $,j as e,B as t,T as P,eX as R,W as h,eY as k}from"./index-43bf7a1c.js";import{I as w,R as B}from"./index-4d9acd7a.js";import{A as z}from"./index-4113d4cf.js";import{T as A,a as E}from"./Tabs-97172399.js";function L(a){const{children:r,value:i,index:s,...l}=a;return e.jsx("div",{role:"tabpanel",hidden:i!==s,id:`simple-tabpanel-${s}`,"aria-labelledby":`simple-tab-${s}`,...l,children:i===s&&e.jsx(t,{mt:2,children:r})})}function W(a){return{id:`simple-tab-${a}`,"aria-controls":`simple-tabpanel-${a}`}}const H=({menuCode:a,fromScreen:r,callback:i,data:s,app_label:l,model_name:m,goBackUrl:j,assignUserCallback:f,headerContent:p,tabsData:c,onTabClick:g})=>{const v=I(),x=T(),{id:d,tab:n}=C(),y=`${l}.${m}`;return M.useEffect(()=>{x(S({showMobileMenu:!1})),x($({code:a,from:r}))},[]),e.jsx(e.Fragment,{children:e.jsx(t,{sx:{width:"100%"},children:e.jsxs(t,{sx:{mt:1},children:[e.jsxs(t,{sx:{py:1,display:"flex",alignItems:"center",justifyContent:"space-between",gap:2},children:[e.jsxs(P,{variant:"h4",sx:{display:"flex",alignItems:"center",gap:1,cursor:"pointer",fontWeight:"500"},onClick:()=>{v(j,{relative:"path"})},children:[e.jsx(R,{size:24}),`${s==null?void 0:s.code}`]}),e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:2},children:[e.jsx(z,{instance_id:d||"",modal_path:y,callback:f}),p&&p]})]}),e.jsx(t,{sx:{borderColor:"divider",mt:1},children:e.jsx(h,{sx:{boxShadow:"none",borderRadius:"10px",pb:"10px",pt:"3px"},children:e.jsx(A,{value:n?+n:0,sx:{".MuiButtonBase-root":{m:0,p:0},".MuiTabs-flexContainer":{p:0,m:0,px:0,gap:"0px"},".MuiTab-root":{minHeight:"18px",padding:"12px !important",minWidth:"18px !important",boxShadow:"none",borderRadius:"6px",mt:"5px"}},"aria-label":"scrollable auto tabs example",variant:"scrollable",scrollButtons:"auto",children:c&&c.map((o,u)=>{const b=w[o.icon];return e.jsx(E,{icon:b?e.jsx(b,{style:{fontSize:16}}):e.jsx(B,{style:{fontSize:16}}),onClick:()=>g(d||"",u,(o==null?void 0:o.url)||""),iconPosition:"start",label:o.label,...W(u)},o.key)})})})}),e.jsx(L,{value:n?+n:0,index:n?+n:0,children:e.jsx(h,{variant:"elevation",sx:{p:2,borderRadius:"10px"},children:e.jsx(k,{})})})]})})})};export{H as D};
