-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdeployed-tab-content.tsx
54 lines (50 loc) · 2.13 KB
/
deployed-tab-content.tsx
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
import styles from './style.module.css';
import { useThemeContext } from '../../context/ThemeContext'
import { TtlPopUp } from './ttl-popup';
type DeployedTabData = {
title: string;
displayedContracts: JSX.Element[] | string;
}
export function DeployedTabContent(props: DeployedTabData) {
// Import the current Theme
const { activeTheme } = useThemeContext();
return (
<div className={styles.deployedTabContainer} data-theme={activeTheme}>
<table className={styles.deployedTabHead}>
<caption data-theme={activeTheme}>{props.title}</caption>
<colgroup>
<col className={styles.contractCol}></col>
<col className={styles.addressCol}></col>
<col className={styles.fromCol}></col>
<col className={styles.ttlCol}></col>
</colgroup>
<thead data-theme={activeTheme}>
<tr>
<th>Contract</th>
<th>Address</th>
<th>From</th>
<th className={styles.ttlThead}><p>TTL</p> <TtlPopUp/></th>
</tr>
</thead>
</table>
<div className={styles.deployedTabContentContainer}>
<table className={styles.deployedTabContent}>
<colgroup>
<col className={styles.contractCol}></col>
<col className={styles.addressCol}></col>
<col className={styles.fromCol}></col>
<col className={styles.ttlCol}></col>
</colgroup>
{typeof(props.displayedContracts) != "string" && (
<tbody>
{props.displayedContracts}
</tbody>
)}
</table>
{typeof(props.displayedContracts) == "string" && (
<div className={styles.tabMessage} data-theme={activeTheme}>{props.displayedContracts}</div>
)}
</div>
</div>
)
}