File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,7 +2,6 @@ import type { ColumnDef } from '@tanstack/table-core';
22import type { ParsedGmae } from '$lib/gmaes' ;
33import { renderComponent } from '$lib/components/ui/data-table/index.js' ;
44import TableActions from './table-actions.svelte' ;
5- import Link from './link.svelte' ;
65import HeaderButtonSort from './header-button-sort.svelte' ;
76
87export 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 } ,
Original file line number Diff line number Diff line change 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 [];
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 ()} />
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments