diff --git a/web/components/contract/prob-change-table.tsx b/web/components/contract/prob-change-table.tsx index 5a616f14..49216b88 100644 --- a/web/components/contract/prob-change-table.tsx +++ b/web/components/contract/prob-change-table.tsx @@ -17,16 +17,20 @@ export function ProbChangeTable(props: { if (!changes) return const { positiveChanges, negativeChanges } = changes - if (positiveChanges.length === 0 && negativeChanges.length === 0) return null - const rows = Math.min( - Math.min(positiveChanges.length, negativeChanges.length), - 3 + const threshold = 0.075 + const countOverThreshold = Math.max( + positiveChanges.findIndex((c) => c.probChanges.day < threshold) + 1, + negativeChanges.findIndex((c) => c.probChanges.day > -threshold) + 1 ) + const maxRows = Math.min(positiveChanges.length, negativeChanges.length) + const rows = Math.min(3, Math.min(maxRows, countOverThreshold)) const filteredPositiveChanges = positiveChanges.slice(0, rows) const filteredNegativeChanges = negativeChanges.slice(0, rows) + if (rows === 0) return
None
+ return (