/ concept-collection / benchcompress
Sign in
concept-collection / benchcompress
benchcompress / web-ui / src / pages / Datasets.tsx
179 lines · 5.2 KBCodeBlameHistory
0968553routingJeremy Magland 1import { Dataset } from "../types";
6c17da5about pageJeremy Magland 2import { Link } from "react-router-dom";
0968553routingJeremy Magland 3
4interface DatasetsProps {
5 datasets: Dataset[];
6}
8function Datasets({ datasets }: DatasetsProps) {
85d3449pagesJeremy Magland 9 return (
10 <div>
11 <h1
12 style={{
13 fontSize: "2rem",
14 fontWeight: "bold",
15 color: "#333",
16 marginBottom: "1rem",
17 }}
18 >
19 Benchmark Datasets
20 </h1>
0968553routingJeremy Magland 21 <div style={{ overflowX: "auto" }}>
22 <table style={{ width: "100%", borderCollapse: "collapse" }}>
23 <thead>
24 <tr style={{ backgroundColor: "#f5f5f5" }}>
25 <th
26 style={{
a3cad9bformat codeJeremy Magland 27 padding: "8px 12px",
0968553routingJeremy Magland 28 textAlign: "left",
a3cad9bformat codeJeremy Magland 29 borderBottom: "1px solid #ddd",
30 fontSize: "0.9rem",
31 whiteSpace: "nowrap",
0968553routingJeremy Magland 32 }}
33 >
34 Name
35 </th>
36 <th
37 style={{
a3cad9bformat codeJeremy Magland 38 padding: "8px 12px",
0968553routingJeremy Magland 39 textAlign: "left",
a3cad9bformat codeJeremy Magland 40 borderBottom: "1px solid #ddd",
41 fontSize: "0.9rem",
42 whiteSpace: "nowrap",
0968553routingJeremy Magland 43 }}
44 >
45 Version
46 </th>
47 <th
48 style={{
a3cad9bformat codeJeremy Magland 49 padding: "8px 12px",
0968553routingJeremy Magland 50 textAlign: "left",
a3cad9bformat codeJeremy Magland 51 borderBottom: "1px solid #ddd",
52 fontSize: "0.9rem",
53 whiteSpace: "nowrap",
0968553routingJeremy Magland 54 }}
55 >
56 Description
57 </th>
58 <th
59 style={{
a3cad9bformat codeJeremy Magland 60 padding: "8px 12px",
0968553routingJeremy Magland 61 textAlign: "left",
a3cad9bformat codeJeremy Magland 62 borderBottom: "1px solid #ddd",
63 fontSize: "0.9rem",
64 whiteSpace: "nowrap",
0968553routingJeremy Magland 65 }}
66 >
67 Tags
68 </th>
db4e6b9links to source codeJeremy Magland 69 <th
70 style={{
a3cad9bformat codeJeremy Magland 71 padding: "8px 12px",
db4e6b9links to source codeJeremy Magland 72 textAlign: "left",
a3cad9bformat codeJeremy Magland 73 borderBottom: "1px solid #ddd",
74 fontSize: "0.9rem",
75 whiteSpace: "nowrap",
db4e6b9links to source codeJeremy Magland 76 }}
77 >
78 Source
79 </th>
0968553routingJeremy Magland 80 </tr>
81 </thead>
82 <tbody>
83 {datasets.map((dataset, index) => (
84 <tr
85 key={`${dataset.name}-${dataset.version}`}
86 style={{
87 backgroundColor: index % 2 === 0 ? "white" : "#fafafa",
88 }}
89 >
a3cad9bformat codeJeremy Magland 90 <td
91 style={{
92 padding: "6px 12px",
93 borderBottom: "1px solid #ddd",
94 fontSize: "0.9rem",
95 }}
96 >
6c17da5about pageJeremy Magland 97 <Link
98 to={`/home?dataset=${encodeURIComponent(dataset.name)}`}
99 style={{
100 color: "#0066cc",
101 textDecoration: "none",
102 fontWeight: "500",
103 }}
104 >
105 {dataset.name}
106 </Link>
0968553routingJeremy Magland 107 </td>
a3cad9bformat codeJeremy Magland 108 <td
109 style={{
110 padding: "6px 12px",
111 borderBottom: "1px solid #ddd",
112 fontSize: "0.9rem",
113 }}
114 >
0968553routingJeremy Magland 115 {dataset.version}
116 </td>
a3cad9bformat codeJeremy Magland 117 <td
118 style={{
119 padding: "6px 12px",
120 borderBottom: "1px solid #ddd",
121 fontSize: "0.9rem",
122 }}
123 >
0968553routingJeremy Magland 124 {dataset.description}
125 </td>
a3cad9bformat codeJeremy Magland 126 <td
127 style={{
128 padding: "6px 12px",
129 borderBottom: "1px solid #ddd",
130 fontSize: "0.9rem",
131 }}
132 >
0968553routingJeremy Magland 133 {dataset.tags.map((tag) => (
134 <span
135 key={tag}
136 style={{
137 display: "inline-block",
138 backgroundColor: "#e1e1e1",
a3cad9bformat codeJeremy Magland 139 padding: "2px 6px",
140 borderRadius: "3px",
141 margin: "1px",
142 fontSize: "0.8rem",
0968553routingJeremy Magland 143 }}
144 >
145 {tag}
146 </span>
147 ))}
148 </td>
a3cad9bformat codeJeremy Magland 149 <td
150 style={{
151 padding: "6px 12px",
152 borderBottom: "1px solid #ddd",
153 fontSize: "0.9rem",
154 }}
155 >
db4e6b9links to source codeJeremy Magland 156 {dataset.source_file && (
157 <a
158 href={dataset.source_file}
159 target="_blank"
160 rel="noopener noreferrer"
161 style={{
162 color: "#0066cc",
163 textDecoration: "none",
164 }}
165 >
166 View Source
167 </a>
168 )}
169 </td>
0968553routingJeremy Magland 170 </tr>
171 ))}
172 </tbody>
173 </table>
85d3449pagesJeremy Magland 174 </div>
175 </div>
176 );
179export default Datasets;
moveopenescclose