Skip to content

Commit 9e45e9b

Browse files
committed
also fix on history page
1 parent 26d97a8 commit 9e45e9b

3 files changed

Lines changed: 6 additions & 13 deletions

File tree

src/routes/history/columns.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { ColumnDef } from '@tanstack/table-core';
22
import type { ParsedGmae } from '$lib/gmaes';
33
import { renderComponent } from '$lib/components/ui/data-table/index.js';
44
import TableActions from './table-actions.svelte';
5-
import Link from './link.svelte';
65
import HeaderButtonSort from './header-button-sort.svelte';
76

87
export const columns: ColumnDef<ParsedGmae>[] = [
@@ -21,12 +20,6 @@ export const columns: ColumnDef<ParsedGmae>[] = [
2120
content: 'Name',
2221
sort: true
2322
}),
24-
cell: ({ row }) => {
25-
return renderComponent(Link, {
26-
children: row.original.name,
27-
href: `/g/${row.original.id}`
28-
});
29-
},
3023
// @ts-ignore
3124
filterFn: 'fuzzy'
3225
},

src/routes/history/data-table.svelte

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import Label from '$lib/components/ui/label/label.svelte';
1818
import Button from '$lib/components/ui/button/button.svelte';
1919
import { historyStore } from '$lib/stores';
20+
import { goto } from '$app/navigation';
2021
type DataTableProps<TData, TValue> = {
2122
columns: ColumnDef<TData, TValue>[];
2223
data: TData[];
@@ -136,7 +137,11 @@
136137
</Table.Header>
137138
<Table.Body>
138139
{#each table.getRowModel().rows as row (row.id)}
139-
<Table.Row data-state={row.getIsSelected() && 'selected'}>
140+
<Table.Row
141+
data-state={row.getIsSelected() && 'selected'}
142+
onclick={() => goto(`/g/${(row.original as { id: string }).id}`)}
143+
class="cursor-pointer"
144+
>
140145
{#each row.getVisibleCells() as cell (cell.id)}
141146
<Table.Cell>
142147
<FlexRender content={cell.column.columnDef.cell} context={cell.getContext()} />

src/routes/history/link.svelte

Lines changed: 0 additions & 5 deletions
This file was deleted.

0 commit comments

Comments
 (0)