import{E as I,b as T,ek as C,r as M,f as S,h as $,j as e,B as t,T as k,eD as P,W as h,eE as R}from"./index-d2b25495.js";import{I as w,R as B}from"./index-19cd9110.js";import{A as E}from"./index-b3c5bebe.js";import{T as z,a as A}from"./Tabs-e137570a.js";function D(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 L(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(k,{variant:"h4",sx:{display:"flex",alignItems:"center",gap:1,cursor:"pointer",fontWeight:"500"},onClick:()=>{v(j,{relative:"path"})},children:[e.jsx(P,{size:24}),`${s==null?void 0:s.code}`]}),e.jsxs(t,{sx:{display:"flex",alignItems:"center",gap:2},children:[e.jsx(E,{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(z,{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(A,{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,...L(u)},o.key)})})})}),e.jsx(D,{value:n?+n:0,index:n?+n:0,children:e.jsx(h,{variant:"elevation",sx:{p:2,borderRadius:"10px"},children:e.jsx(R,{})})})]})})})};export{H as D};
