import{d as y,c as t,a as s,F as o,k as r,b as h,o as a,q as b,t as c,n as i,s as C,h as g}from"./index.js";const w={class:"table-wrap"},x=["onClick"],f={key:0},v=["colspan"],S=y({__name:"DataTable",props:{columns:{},rows:{default:()=>[]},clickable:{type:Boolean}},emits:["rowClick"],setup(l,{emit:d}){const u=d;return(m,B)=>(a(),t("div",w,[s("table",null,[s("thead",null,[s("tr",null,[(a(!0),t(o,null,r(l.columns,e=>(a(),t("th",{key:e.key,style:b(e.width?{width:e.width}:{})},c(e.label),5))),128))])]),s("tbody",null,[(a(!0),t(o,null,r(l.rows,(e,k)=>(a(),t("tr",{key:k,class:i({clickable:l.clickable}),onClick:n=>l.clickable&&u("rowClick",e)},[(a(!0),t(o,null,r(l.columns,n=>(a(),t("td",{key:n.key,class:i({mono:n.mono})},[C(m.$slots,n.key,{row:e,value:e[n.key]},()=>[g(c(e[n.key]??"—"),1)])],2))),128))],10,x))),128)),l.rows.length===0?(a(),t("tr",f,[s("td",{colspan:l.columns.length,style:{"text-align":"center",color:"var(--text-muted)",padding:"32px"}}," No data ",8,v)])):h("",!0)])])]))}});export{S as _};
