import{A as _,f as g}from"./AddEdit-D03Mg4-I.js";import{_ as k,x as b,Z as T,a as $,r as u,e as C,o as n,g as E,f as c,w as s,V as d,F as v,c as a,J as h,p as w,B as D,ah as S}from"./app-DGDivIsO.js";const B=b({props:{btnType:{default:"default"},tooltip:{default:!0},customType:{default:"button"}},emits:["onAddSuccess"],components:{PlusOutlined:T,AddEdit:_},setup(e,{emit:p}){const{permsArray:m}=$(),{initData:i,addEditUrl:f}=g(),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=C("PlusOutlined"),r=D,y=S,A=C("AddEdit");return e.permsArray.includes("designations_create")||e.permsArray.includes("admin")?(n(),E("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(),E(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 M=k(B,[["render",P]]);export{M as D};
