Trading

Deals List

Deal history table with summary statistics (total deals, win rate, total profit, total loss), an inline note toggle per row, and Eye/Info/Edit/Delete actions. Built on theTable and Button primitives.

Preview

Fullscreen
Deals
Total Deals
3
Win Rate
66.7%
Total Profit
+$6,470.00
Total Loss
-$900.00
NameStocksCoinsPairsCreditedDebitedTotalTimeActions
BTC SwingHeld through the weekly close
021
$134,470.00
(3 trades)
$128,400.00
(2 trades)
$6,070.00
(5 trades)
2026-05-01 09:12
2026-05-08 17:40
(7d 8h)
ETH Scalp
0101
$35,200.00
(4 trades)
$36,100.00
(4 trades)
-$900.00
(8 trades)
2026-05-10 11:00
2026-05-10 14:25
(3h 25m)
SOL PositionScaling in
01201
$18,200.00
(2 trades)
$17,800.00
(1 trades)
$400.00
(3 trades)
2026-05-15 08:00
2026-05-18 19:30
(3d 11h)

Source

Copy this file to components/trading/deals-list.tsx

tsx
'use client'

import * as React from 'react'
import { useState } from 'react'
import { Plus, Info, Edit, Trash2, TrendingUp, Eye } from 'lucide-react'
import { Button } from '@/components/ui/button'
import {
  Table, TableBody, TableCell, TableHead, TableHeader, TableRow,
} from '@/components/ui/table'
import { cn } from '@/lib/utils'

export interface Deal {
  id: string
  name?: string
  note?: string
  stocks: number
  coins: number
  pairs: number
  credited: number
  credited_trades: number
  debited: number
  debited_trades: number
  total: number
  total_trades: number
  timestamp_open: string
  timestamp_closed: string
  duration: string
}

export interface DealsListProps {
  deals: Deal[]
  onSelectDeal: (dealId: string) => void
  onAddDeal: () => void
  onEditDeal: (dealId: string) => void
  onDeleteDeal: (dealId: string) => void
  className?: string
}

// Summary stats (count, win rate, profit, loss), a deals table with
// per-row note toggle and Eye/Info/Edit/Trash actions, plus an empty state.
// See components/trading/deals-list.tsx for the full implementation.

Props

PropType
deals*Deal[]
onSelectDeal*(dealId: string) => void
onAddDeal*() => void
onEditDeal*(dealId: string) => void
onDeleteDeal*(dealId: string) => void
classNamestring