import{jsx as e,jsxs as m}from"react/jsx-runtime";import{B as s}from"./button-BvFBRYHq.js";import{T as c,a as n,b as a,c as d,d as f,e as l}from"./table-BrXe3s2z.js";import{Loader2 as p,RefreshCw as u}from"lucide-react";import{f as x,a as N,b as o}from"./formatters-BKhXALLU.js";import{StatusBadge as b}from"./StatusBadge-Bhtqye6R.js";import"@radix-ui/react-slot";import"class-variance-authority";import"./utils-CMbmcP35.js";import"clsx";import"tailwind-merge";import"./badge-CFi7bqqA.js";import"./constants-DljxNoU5.js";const H=({transactions:i,onSync:h,isSyncing:t})=>i.length===0?e("div",{className:"text-center py-8 text-muted-foreground",children:"No transactions found"}):e("div",{className:"rounded-md border overflow-x-auto",children:m(c,{children:[e(n,{children:m(a,{children:[e(d,{children:"ID"}),e(d,{children:"Reference"}),e(d,{children:"Amount"}),e(d,{children:"Gold"}),e(d,{children:"Payment Method"}),e(d,{children:"Status"}),e(d,{children:"Created"}),e(d,{children:"Paid At"}),e(d,{className:"text-right",children:"Actions"})]})}),e(f,{children:i.map(r=>m(a,{children:[m(l,{className:"font-medium",children:["#",r.id]}),e(l,{className:"font-mono text-xs",children:r.reference||r.reference_id||r.merchant_order_id||r.transaction_id||"-"}),e(l,{children:x(r.amount)}),e(l,{children:N(r.gold_amount)}),m(l,{children:[r.payment_method||"-",r.payment_channel&&e("div",{className:"text-xs text-muted-foreground",children:r.payment_channel})]}),e(l,{children:e(b,{status:r.status})}),e(l,{className:"text-sm",children:o(r.created_at)}),e(l,{className:"text-sm",children:o(r.paid_at)}),e(l,{className:"text-right",children:e(s,{size:"sm",variant:"ghost",onClick:()=>h(r.id),disabled:t(r.id),children:t(r.id)?e(p,{className:"w-4 h-4 animate-spin"}):e(u,{className:"w-4 h-4"})})})]},r.id))})]})});export{H as TransactionTable};
