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