From 5e2ae16196bcc05e3b68c76659c24d3198a31775 Mon Sep 17 00:00:00 2001 From: Rory Devitt Date: Fri, 18 Jul 2025 09:56:40 +0100 Subject: [PATCH] Sort participants by equity --- sweepy-ui/src/components/SweepstakeTable.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sweepy-ui/src/components/SweepstakeTable.jsx b/sweepy-ui/src/components/SweepstakeTable.jsx index 37ebb55..d33108f 100644 --- a/sweepy-ui/src/components/SweepstakeTable.jsx +++ b/sweepy-ui/src/components/SweepstakeTable.jsx @@ -7,6 +7,10 @@ function SweepstakeTable({ data }) { setExpandedRow(expandedRow === index ? null : index); }; + const sortedParticipants = [...data.participants].sort((a, b) => { + return parseFloat(b.equity) - parseFloat(a.equity); + }); + return (
@@ -17,7 +21,7 @@ function SweepstakeTable({ data }) { - {data.participants.map((p, index) => ( + {sortedParticipants.map((p, index) => ( toggleRow(index)}>
{p.name}