-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathVerifyCells.tsx
More file actions
59 lines (58 loc) · 1.65 KB
/
VerifyCells.tsx
File metadata and controls
59 lines (58 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { maybeGetValueTextFromOptions } from "@/helpers";
import type { OracleQueryUI } from "@/types";
import { Currency } from "../Currency";
import { LivenessProgressBar } from "../LivenessProgressBar";
import { TD, Text } from "./style";
import ExternalLink from "public/assets/icons/external-link.svg";
import { isUnresolvable } from "@/helpers/validators";
export function VerifyCells({
valueText,
proposeOptions,
timeMilliseconds,
livenessEndsMilliseconds,
disputeHash,
bond,
chainId,
tokenAddress,
oracleType,
}: OracleQueryUI) {
const isManaged = oracleType === "Managed Optimistic Oracle V2";
const valuesToShow = Array.isArray(valueText)
? valueText
: [maybeGetValueTextFromOptions(valueText, proposeOptions)];
return (
<>
<TD>
<Text>
{valuesToShow.length > 1 ? (
<span>
See Proposal
<ExternalLink className="inline rounded-none ml-2" />{" "}
</span>
) : isUnresolvable(valuesToShow[0] ?? "") ? (
"Unresolvable"
) : (
valuesToShow[0]
)}
</Text>
</TD>
<TD>
<Text>
<Currency address={tokenAddress} chainId={chainId} value={bond} />
</Text>
</TD>
{disputeHash && <TD>Disputed</TD>}
{!disputeHash &&
livenessEndsMilliseconds !== undefined &&
timeMilliseconds !== undefined ? (
<TD>
<LivenessProgressBar
startTime={timeMilliseconds}
endTime={livenessEndsMilliseconds}
endedLabel={isManaged ? "Awaiting Settlement" : undefined}
/>
</TD>
) : undefined}
</>
);
}