Skip to content
This repository was archived by the owner on Jun 28, 2025. It is now read-only.

Commit 9b9933b

Browse files
author
Manuel Proß
committed
feat(web): add scripts-page, add dummy table
1 parent e7c90c0 commit 9b9933b

File tree

1 file changed

+93
-0
lines changed

1 file changed

+93
-0
lines changed

web/src/app/scripts/page.tsx

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
'use client';
2+
3+
import { useState } from 'react';
4+
import { ColumnDef, flexRender, getCoreRowModel, useReactTable } from '@tanstack/react-table';
5+
6+
type Script = {
7+
name: string;
8+
type: 'colorScheme' | 'utility' | 'syntax';
9+
description: string;
10+
};
11+
const dummyScripts: Script[] = [
12+
{
13+
name: 'Script 1',
14+
type: 'colorScheme',
15+
description:
16+
'Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.',
17+
},
18+
{
19+
name: 'Script 2',
20+
type: 'utility',
21+
description:
22+
'Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.',
23+
},
24+
{
25+
name: 'Script 3',
26+
type: 'syntax',
27+
description:
28+
'Lorem ipsum dolor sit amet, qui minim labore adipisicing minim sint cillum sint consectetur cupidatat.',
29+
},
30+
];
31+
32+
const columns: ColumnDef<Script>[] = [
33+
{
34+
accessorKey: 'name',
35+
header: 'Name',
36+
},
37+
{
38+
accessorKey: 'downloadIcon',
39+
header: 'Download',
40+
},
41+
{
42+
accessorKey: 'type',
43+
header: 'Type',
44+
},
45+
{
46+
accessorKey: 'description',
47+
header: 'Description',
48+
},
49+
];
50+
51+
export default function Scripts() {
52+
const [data] = useState<Script[]>(dummyScripts);
53+
const table = useReactTable({
54+
data,
55+
columns,
56+
getCoreRowModel: getCoreRowModel(),
57+
});
58+
return (
59+
<table>
60+
<thead>
61+
{table.getHeaderGroups().map((headerGroup) => {
62+
return (
63+
<tr key={headerGroup.id}>
64+
{headerGroup.headers.map((header) => {
65+
return (
66+
<th id={header.id} key={header.id}>
67+
{' '}
68+
{header.isPlaceholder
69+
? null
70+
: flexRender(header.column.columnDef.header, header.getContext())}
71+
</th>
72+
);
73+
})}
74+
</tr>
75+
);
76+
})}
77+
</thead>
78+
<tbody>
79+
{table.getRowModel().rows.map((row) => {
80+
return (
81+
<tr key={row.id}>
82+
{row.getVisibleCells().map((cell) => {
83+
return (
84+
<td key={cell.id}>{flexRender(cell.column.columnDef.cell, cell.getContext())}</td>
85+
);
86+
})}
87+
</tr>
88+
);
89+
})}
90+
</tbody>
91+
</table>
92+
);
93+
}

0 commit comments

Comments
 (0)