-
- {' '}
- {comment.betId == null &&
- commenterPositionProb != null &&
- commenterPositionOutcome != null &&
- commenterPositionShares != null &&
- commenterPositionShares > 0 &&
- contract.outcomeType !== 'NUMERIC' && (
- <>
- {'is '}
-
- >
- )}
- {bought} {money}
- {contract.outcomeType !== 'FREE_RESPONSE' && betOutcome && (
- <>
- {' '}
- of{' '}
-
- >
- )}
-
- {totalAwarded > 0 && (
-
- +{formatMoney(totalAwarded)}
-
- )}
-
+
+
+
-
+
{onReplyClick && (
-
+
+
)}
{showTip && (
)}
-
+
)
})
@@ -273,3 +316,74 @@ export function ContractCommentInput(props: {
/>
)
}
+
+export function FeedCommentHeader(props: {
+ comment: ContractComment
+ contract: Contract
+}) {
+ const { comment, contract } = props
+ const {
+ userUsername,
+ userName,
+ commenterPositionProb,
+ commenterPositionShares,
+ commenterPositionOutcome,
+ createdTime,
+ bountiesAwarded,
+ } = comment
+ const betOutcome = comment.betOutcome
+ let bought: string | undefined
+ let money: string | undefined
+ if (comment.betAmount != null) {
+ bought = comment.betAmount >= 0 ? 'bought' : 'sold'
+ money = formatMoney(Math.abs(comment.betAmount))
+ }
+ const totalAwarded = bountiesAwarded ?? 0
+ return (
+