4import { useTagFilter } from "../hooks/useTagFilter";
6interface DatasetsProps {
7 datasets: Dataset[];
8}
10function Datasets({ datasets }: DatasetsProps) {
12 selectedTags,
13 availableTags,
14 filteredItems: filteredDatasets,
15 toggleTag,
16 } = useTagFilter(datasets);
19 <div>
21 <h1
22 style={{
23 fontSize: "2rem",
24 fontWeight: "bold",
25 color: "#333",
26 marginBottom: "1rem",
27 }}
28 >
29 Benchmark Datasets
30 </h1>
31 <TagFilter
32 availableTags={availableTags}
33 selectedTags={selectedTags}
34 onTagToggle={toggleTag}
35 label="Filter datasets"
36 />
37 </div>
39 <table style={{ width: "100%", borderCollapse: "collapse" }}>
40 <thead>
41 <tr style={{ backgroundColor: "#f5f5f5" }}>
42 <th
43 style={{
47 fontSize: "0.9rem",
48 whiteSpace: "nowrap",
50 >
51 Name
52 </th>
53 <th
54 style={{
58 fontSize: "0.9rem",
59 whiteSpace: "nowrap",
61 >
62 Version
63 </th>
64 <th
65 style={{
69 fontSize: "0.9rem",
70 whiteSpace: "nowrap",
72 >
73 Description
74 </th>
75 <th
76 style={{
80 fontSize: "0.9rem",
81 whiteSpace: "nowrap",
83 >
84 Tags
85 </th>
87 style={{
91 fontSize: "0.9rem",
92 whiteSpace: "nowrap",
94 >
95 Source
96 </th>
98 style={{
99 padding: "8px 12px",
100 textAlign: "left",
101 borderBottom: "1px solid #ddd",
102 fontSize: "0.9rem",
103 whiteSpace: "nowrap",
104 }}
105 >
106 Data
107 </th>
109 </thead>
110 <tbody>
113 key={`${dataset.name}-${dataset.version}`}
114 style={{
115 backgroundColor: index % 2 === 0 ? "white" : "#fafafa",
116 }}
117 >
119 style={{
120 padding: "6px 12px",
121 borderBottom: "1px solid #ddd",
122 fontSize: "0.9rem",
123 }}
124 >
128 color: "#0066cc",
129 textDecoration: "none",
130 fontWeight: "500",
131 }}
132 >
133 {dataset.name}
134 </Link>
137 style={{
138 padding: "6px 12px",
139 borderBottom: "1px solid #ddd",
140 fontSize: "0.9rem",
141 }}
142 >
144 </td>
146 style={{
147 padding: "6px 12px",
148 borderBottom: "1px solid #ddd",
149 fontSize: "0.9rem",
150 }}
151 >
153 </td>
155 style={{
156 padding: "6px 12px",
157 borderBottom: "1px solid #ddd",
158 fontSize: "0.9rem",
159 }}
160 >
162 <span
163 key={tag}
164 style={{
165 display: "inline-block",
166 backgroundColor: "#e1e1e1",
168 borderRadius: "3px",
169 margin: "1px",
170 fontSize: "0.8rem",
172 >
173 {tag}
174 </span>
175 ))}
176 </td>
178 style={{
179 padding: "6px 12px",
180 borderBottom: "1px solid #ddd",
181 fontSize: "0.9rem",
182 }}
183 >
185 <a
186 href={dataset.source_file}
187 target="_blank"
188 rel="noopener noreferrer"
189 style={{
190 color: "#0066cc",
191 textDecoration: "none",
192 }}
193 >
194 View Source
195 </a>
196 )}
197 </td>
199 style={{
200 padding: "6px 12px",
201 borderBottom: "1px solid #ddd",
202 fontSize: "0.9rem",
203 }}
204 >
208 download={`${dataset.name}-${dataset.version}.npy`}
210 color: "#0066cc",
211 textDecoration: "none",
212 }}
213 >
214 Download
215 </a>
216 )}
217 </td>
219 ))}
220 </tbody>
221 </table>
223 </div>
224 );
225}
227export default Datasets;