This repository was archived by the owner on Nov 28, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathAddressSvmTable.tsx
More file actions
53 lines (50 loc) · 1.85 KB
/
AddressSvmTable.tsx
File metadata and controls
53 lines (50 loc) · 1.85 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
import copy from "copy-to-clipboard";
import CopyIcon from "./icons/CopyIcon";
import { StyledTd } from "./Table";
const AddressSvmTable = ({
entries,
explorer,
}: {
entries: { name: string; value: string; link?: boolean }[];
explorer: string;
}) => {
return (
<table>
<tbody>
{entries.map(({ name, value, link }) => {
const addLink = explorer.includes("$ADDRESS") && link;
return (
<tr key={name}>
<StyledTd>{name}</StyledTd>
<StyledTd>
{addLink ? (
<a
href={explorer.replace("$ADDRESS", value)}
className="nx-text-primary-600 nx-underline nx-decoration-from-font [text-underline-position:from-font]"
target="_blank"
rel="noopener noreferrer"
>
<code className="nx-border-black nx-border-opacity-[0.04] nx-bg-opacity-[0.03] nx-bg-black nx-break-words nx-rounded-md nx-border nx-py-0.5 nx-px-[.25em] nx-text-[.9em] dark:nx-border-white/10 dark:nx-bg-white/10">
{value}
</code>
</a>
) : (
<code className="nx-border-black nx-border-opacity-[0.04] nx-bg-opacity-[0.03] nx-bg-black nx-break-words nx-rounded-md nx-border nx-py-0.5 nx-px-[.25em] nx-text-[.9em] dark:nx-border-white/10 dark:nx-bg-white/10">
{value}
</code>
)}
<button
onClick={() => copy(value)}
className="p-1 hover:bg-light dark:hover:bg-dark rounded"
>
<CopyIcon className="shrink-0" />
</button>
</StyledTd>
</tr>
);
})}
</tbody>
</table>
);
};
export default AddressSvmTable;