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