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