import{A as k,f as _}from"./AddEdit-CYpQ7bcb.js";import{_ as g,x as T,Z as b,a as $,r as u,e as C,o as a,g as E,f as p,w as s,V as n,F as v,c as d,J as h,p as w,B as S,ah as B}from"./app-DNXD_-wA.js";const D=T({props:{btnType:{default:"default"},tooltip:{default:!0},customType:{default:"button"},panelType:{default:"admin"}},emits:["onAddSuccess"],components:{PlusOutlined:b,AddEdit:k},setup(e,{emit:c}){const{permsArray:m}=$(),{initData:l,addEditUrl:f}=_(),o=u(!1),i=u("add"),t=u({...l});return{permsArray:m,visible:o,addEditType:i,addEditUrl:f,formData:t,addEditSuccess:()=>{o.value=!1,t.value={...l},c("onAddSuccess")},onClose:()=>{o.value=!1},showAdd:()=>{o.value=!0}}}}),L={key:0};function O(e,c,m,l,f,o){const i=w,t=C("PlusOutlined"),r=S,y=B,A=C("AddEdit");return e.permsArray.includes("translations_create")||e.permsArray.includes("admin")||e.panelType=="superadmin"?(a(),E("div",L,[e.customType=="menu"?(a(),p(i,{onClick:e.showAdd,key:"categories"},{icon:s(()=>[n(e.$slots,"icon")]),default:s(()=>[n(e.$slots,"default")]),_:3},8,["onClick"])):(a(),E(v,{key:1},[e.tooltip?(a(),p(y,{key:0,placement:"topLeft",title:e.$t("langs.add"),"arrow-point-at-center":""},{default:s(()=>[d(r,{onClick:e.showAdd,class:"ml-5 no-border-radius",type:e.btnType},{icon:s(()=>[d(t)]),default:s(()=>[n(e.$slots,"default")]),_:3},8,["onClick","type"])]),_:3},8,["title"])):(a(),p(r,{key:1,onClick:e.showAdd,class:"ml-5 no-border-radius",type:e.btnType},{icon:s(()=>[d(t)]),default:s(()=>[n(e.$slots,"default")]),_:3},8,["onClick","type"]))],64)),d(A,{addEditType:e.addEditType,visible:e.visible,url:e.addEditUrl,onAddEditSuccess:e.addEditSuccess,onClosed:e.onClose,formData:e.formData,data:e.formData,pageTitle:e.$t("langs.add"),successMessage:e.$t("langs.created")},null,8,["addEditType","visible","url","onAddEditSuccess","onClosed","formData","data","pageTitle","successMessage"])])):h("",!0)}const F=g(D,[["render",O]]);export{F as L};
