From 329d8165ef0fbbc4e0e917890eadea289352af13 Mon Sep 17 00:00:00 2001 From: Reinis Ivanovs Date: Tue, 24 Dec 2024 00:42:16 +0200 Subject: [PATCH] fix tag column --- apps/web/src/features/browse/browse-page.tsx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/apps/web/src/features/browse/browse-page.tsx b/apps/web/src/features/browse/browse-page.tsx index 81bda3c..0b42027 100644 --- a/apps/web/src/features/browse/browse-page.tsx +++ b/apps/web/src/features/browse/browse-page.tsx @@ -5,6 +5,7 @@ import { type GridRenderCellParams, type GridSortModel, } from '@mui/x-data-grid'; +import { User } from 'apps/api/src/types'; import { useState } from 'react'; import { Page } from '../../shared/ui/page'; import { trpc } from '../../trpc'; @@ -70,12 +71,8 @@ export const BrowsePage = () => { headerName: 'Tags', width: 200, sortable: false, - valueFormatter: (params: GridRenderCellParams) => { - const tags = params.value || []; - return tags.join(', '); - }, + valueFormatter: (params: string[]) => params.join(', '), }, - { field: 'createdAt', headerName: 'Created At', @@ -84,14 +81,12 @@ export const BrowsePage = () => { valueFormatter: (date: string) => new Date(date).toLocaleString(), type: 'dateTime', }, - { field: 'createdBy', headerName: 'Created By', width: 150, - valueGetter: (params: GridRenderCellParams) => - params.value?.name || params.value?.email, + valueGetter: (params: User) => params?.name || params?.email, }, ];