-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
Copy pathjsBundleListClient.tsx
55 lines (50 loc) · 1.18 KB
/
jsBundleListClient.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
55
'use client';
import styled from '@emotion/styled';
const ChecksumValue = styled.code`
font-size: 0.75em;
white-space: nowrap;
`;
type File = {
checksums: {
name: string;
value: string;
}[];
name: string;
};
type Props = {
files: File[];
};
export function JsBundleListClient({files}: Props) {
return (
<table style={{display: 'block', overflow: 'scroll'}}>
<thead>
<tr>
<th>File</th>
<th>Integrity Checksum</th>
</tr>
</thead>
<tbody>
{files
.filter(file => file.name.endsWith('.js'))
.map(file => (
<tr key={file.name}>
<td
style={{
fontSize: '0.9em',
verticalAlign: 'middle',
whiteSpace: 'nowrap',
}}
>
{file.name}
</td>
<td style={{verticalAlign: 'middle', width: '100%'}}>
<ChecksumValue>
{`sha384-${file.checksums.find(c => c.name === 'sha384-base64')?.value}`}
</ChecksumValue>
</td>
</tr>
))}
</tbody>
</table>
);
}