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