Add genre link to table cells
This commit is contained in:
parent
ee83fdba71
commit
0b207c78e7
1 changed files with 5 additions and 2 deletions
|
@ -1,9 +1,10 @@
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
import type { ICellRendererParams } from '@ag-grid-community/core';
|
import type { ICellRendererParams } from '@ag-grid-community/core';
|
||||||
import { Link } from 'react-router-dom';
|
import { generatePath, Link } from 'react-router-dom';
|
||||||
import type { AlbumArtist, Artist } from '/@/renderer/api/types';
|
import type { AlbumArtist, Artist } from '/@/renderer/api/types';
|
||||||
import { Text } from '/@/renderer/components/text';
|
import { Text } from '/@/renderer/components/text';
|
||||||
import { CellContainer } from '/@/renderer/components/virtual-table/cells/generic-cell';
|
import { CellContainer } from '/@/renderer/components/virtual-table/cells/generic-cell';
|
||||||
|
import { AppRoute } from '/@/renderer/router/routes';
|
||||||
|
|
||||||
export const GenreCell = ({ value, data }: ICellRendererParams) => {
|
export const GenreCell = ({ value, data }: ICellRendererParams) => {
|
||||||
return (
|
return (
|
||||||
|
@ -30,7 +31,9 @@ export const GenreCell = ({ value, data }: ICellRendererParams) => {
|
||||||
component={Link}
|
component={Link}
|
||||||
overflow="hidden"
|
overflow="hidden"
|
||||||
size="md"
|
size="md"
|
||||||
to="/"
|
to={generatePath(AppRoute.LIBRARY_GENRES_SONGS, {
|
||||||
|
genreId: item.id,
|
||||||
|
})}
|
||||||
>
|
>
|
||||||
{item.name || '—'}
|
{item.name || '—'}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
Reference in a new issue