Changeset View
Changeset View
Standalone View
Standalone View
web/e.cash/app/components/Home/LiveCard.tsx
| Show First 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | export default function LiveCard() { | ||||
| // Get the most recent MAX_TRANSACTIONS transactions | // Get the most recent MAX_TRANSACTIONS transactions | ||||
| const transactions = useMemo(() => { | const transactions = useMemo(() => { | ||||
| return mempool.slice(0, MAX_TRANSACTIONS); | return mempool.slice(0, MAX_TRANSACTIONS); | ||||
| }, [mempool]); | }, [mempool]); | ||||
| const isLoading = isLoadingMempool; | const isLoading = isLoadingMempool; | ||||
| return ( | return ( | ||||
| <div className="flex w-full min-w-[250px] flex-col items-center self-stretch overflow-hidden rounded-lg border-t-2 border-t-white/10 bg-white/3 p-4 transition-all hover:bg-linear-to-tr hover:from-white/2 hover:to-[#21173B] xl:p-8"> | <div className="flex w-full min-w-[250px] flex-col items-center justify-between self-stretch overflow-hidden rounded-lg border-t-2 border-t-white/10 bg-white/3 p-4 transition-all hover:bg-linear-to-tr hover:from-white/2 hover:to-[#21173B] xl:p-8"> | ||||
| <div className="relative mb-10 w-full overflow-y-auto"> | <div className="relative mb-10 w-full overflow-y-auto"> | ||||
| {!isLoading && transactions.length > 0 ? ( | {!isLoading && transactions.length > 0 ? ( | ||||
| <div className="h-full w-full overflow-hidden"> | <div className="h-full w-full overflow-hidden"> | ||||
| <div className="flex flex-col gap-1"> | <div className="flex flex-col gap-1"> | ||||
| {transactions.map((tx, index) => { | {transactions.map((tx, index) => { | ||||
| const amount = calculateAmount(tx); | const amount = calculateAmount(tx); | ||||
| const timeSince = formatTimeSince( | const timeSince = formatTimeSince( | ||||
| tx.timeFirstSeen, | tx.timeFirstSeen, | ||||
| ▲ Show 20 Lines • Show All 102 Lines • Show Last 20 Lines | |||||