Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion sweepy-ui/src/components/SweepstakeTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className="overflow-x-auto">
<table className="min-w-full border rounded-lg">
Expand All @@ -17,7 +21,7 @@ function SweepstakeTable({ data }) {
</tr>
</thead>
<tbody className="bg-white divide-y divide-gray-200">
{data.participants.map((p, index) => (
{sortedParticipants.map((p, index) => (
<React.Fragment key={index}>
<tr className="cursor-pointer" onClick={() => toggleRow(index)}>
<td className="px-4 py-2">{p.name}</td>
Expand Down