import{u as g,o as s,c as f,w as t,b as e,l as m,t as n,S as _,al as b,C as p,E as y,aC as C,H as h,p as c,d as u,B as V,W as v,k as x,aD as I,f as S,D as k}from"./index-525d7e2b.js";import{_ as B}from"./_plugin-vue_export-helper-c27b6911.js";const E={name:"ItemCard",setup(){const{t:l}=g();return{t:l}},props:{item:{type:Object,required:!0},titleField:{type:String,default:"id"},enabledField:{type:String,default:"enable"},bglogo:{type:String,default:null},loading:{type:Boolean,default:!1}},emits:["toggle-enabled","delete","edit"],methods:{getItemTitle(){return this.item[this.titleField]},getItemEnabled(){return this.item[this.enabledField]},toggleEnabled(){this.$emit("toggle-enabled",this.item)}}},T=["title"],w={key:0,class:"d-flex justify-end align-center",style:{position:"absolute",bottom:"16px",right:"16px",opacity:"0.2"}};function F(l,i,a,o,N,d){return s(),f(k,{class:"item-card hover-elevation",style:{padding:"4px"},elevation:"0"},{default:t(()=>[e(y,{class:"d-flex justify-space-between align-center pb-1 pt-3"},{default:t(()=>[m("span",{class:"text-h2 text-truncate",title:d.getItemTitle()},n(d.getItemTitle()),9,T),e(_,{location:"top"},{activator:t(({props:r})=>[e(b,p({color:"primary","hide-details":"",density:"compact","model-value":d.getItemEnabled(),loading:a.loading,disabled:a.loading},r,{"onUpdate:modelValue":d.toggleEnabled}),null,16,["model-value","loading","disabled","onUpdate:modelValue"])]),default:t(()=>[m("span",null,n(d.getItemEnabled()?o.t("core.common.itemCard.enabled"):o.t("core.common.itemCard.disabled")),1)]),_:1})]),_:1}),e(h,null,{default:t(()=>[C(l.$slots,"item-details",{item:a.item},void 0,!0)]),_:3}),e(v,{style:{margin:"8px"}},{default:t(()=>[e(c,{variant:"outlined",color:"error",rounded:"xl",onClick:i[0]||(i[0]=r=>l.$emit("delete",a.item))},{default:t(()=>[u(n(o.t("core.common.itemCard.delete")),1)]),_:1}),e(c,{variant:"tonal",color:"primary",rounded:"xl",onClick:i[1]||(i[1]=r=>l.$emit("edit",a.item))},{default:t(()=>[u(n(o.t("core.common.itemCard.edit")),1)]),_:1}),e(V)]),_:1}),a.bglogo?(s(),x("div",w,[e(I,{src:a.bglogo,contain:"",width:"120",height:"120"},null,8,["src"])])):S("",!0)]),_:3})}const U=B(E,[["render",F],["__scopeId","data-v-a6eece33"]]);export{U as I};
