import{Kt as e,Q as t,Qt as n,R as r,Tn as i,Y as a,Z as o,at as s,fr as c,it as l,lr as u,or as d,r as f,st as p}from"./dist-CoD0k1Bd.js";import{t as m}from"./coins-DKcqhvQE.js";import{t as h}from"./routes-BZ4t1sNs.js";import{t as g}from"./Heading-CCd5Tysh.js";import{i as _,n as v,r as y,t as b}from"./CardTitle-Gsnbe-4f.js";import{t as x}from"./badge-n_RZ0blh.js";import{t as S}from"./Pagination-BRYVDO_a.js";var C={class:`flex flex-col space-y-6`},w={class:`text-2xl font-bold tabular-nums`},T={class:`overflow-hidden rounded-xl border`},E={class:`w-full text-sm`},D={class:`divide-y`},O={class:`px-4 py-3 whitespace-nowrap`},k={class:`px-4 py-3 font-mono text-xs`},A={class:`px-4 py-3 text-muted-foreground`},j={class:`px-4 py-3 text-muted-foreground`},M={class:`px-4 py-3 text-right`},N={key:0},P=p({layout:{breadcrumbs:[{title:`Dashboard`,href:h()},{title:`Kredit`,href:`/credits`}]},__name:`Index`,props:{histories:{},credit:{}},setup(p){let h=p;return(p,P)=>(e(),t(r,null,[s(d(f),{title:`Riwayat Kredit`}),a(`div`,C,[s(g,{title:`Riwayat Kredit`,description:`Mutasi saldo credit In/Out`}),s(d(_),{class:`max-w-xs`},{default:i(()=>[s(d(v),{class:`flex flex-row items-center justify-between space-y-0 pb-2`},{default:i(()=>[s(d(b),{class:`text-sm font-medium text-muted-foreground`},{default:i(()=>[...P[0]||=[l(`Saldo Kredit`,-1)]]),_:1}),s(d(m),{class:`size-4 text-muted-foreground`})]),_:1}),s(d(y),null,{default:i(()=>[a(`div`,w,c(h.credit.toLocaleString(`id-ID`)),1),P[1]||=a(`p`,{class:`text-xs text-muted-foreground`},`1 credit = 1 klik valid`,-1)]),_:1})]),_:1}),a(`div`,T,[a(`table`,E,[P[3]||=a(`thead`,{class:`bg-muted/50 text-left text-xs uppercase text-muted-foreground`},[a(`tr`,null,[a(`th`,{class:`px-4 py-3 font-medium`},`Tanggal`),a(`th`,{class:`px-4 py-3 font-medium`},`Referensi`),a(`th`,{class:`px-4 py-3 font-medium`},`Keterangan`),a(`th`,{class:`px-4 py-3 font-medium`},`Pengguna`),a(`th`,{class:`px-4 py-3 font-medium text-right`},`Jenis`),a(`th`,{class:`px-4 py-3 font-medium text-right`},`Jumlah`)])],-1),a(`tbody`,D,[(e(!0),t(r,null,n(h.histories.data,n=>(e(),t(`tr`,{key:n.id,class:`hover:bg-muted/30`},[a(`td`,O,c(new Date(n.tanggal).toLocaleString(`id-ID`)),1),a(`td`,k,c(n.invoice??`—`),1),a(`td`,A,c(n.keterangan??`—`),1),a(`td`,j,c(n.user?.name??`—`),1),a(`td`,M,[s(d(x),{variant:n.jenis===`In`?`default`:`destructive`},{default:i(()=>[l(c(n.jenis),1)]),_:2},1032,[`variant`])]),a(`td`,{class:u([`px-4 py-3 text-right tabular-nums`,n.jenis===`In`?`text-green-600`:`text-red-600`])},c(n.jenis===`In`?`+`:`-`)+c(n.credit.toLocaleString(`id-ID`)),3)]))),128)),h.histories.data.length===0?(e(),t(`tr`,N,[...P[2]||=[a(`td`,{colspan:`6`,class:`px-4 py-8 text-center text-muted-foreground`},`Belum ada mutasi kredit.`,-1)]])):o(``,!0)])])]),s(S,{links:h.histories.links,from:h.histories.from,to:h.histories.to,total:h.histories.total},null,8,[`links`,`from`,`to`,`total`])])],64))}});export{P as default};