Skip to content

Commit

Permalink
fix tag column
Browse files Browse the repository at this point in the history
  • Loading branch information
slikts committed Dec 23, 2024
1 parent 39ac444 commit 329d816
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions apps/web/src/features/browse/browse-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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',
Expand All @@ -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,
},
];

Expand Down

0 comments on commit 329d816

Please sign in to comment.