N-FIN-49: show clear column if no category selected

This commit is contained in:
Markus Thielker 2024-03-17 12:04:38 +01:00
parent 50b8ba399d
commit d5c4f02871
No known key found for this signature in database

View file

@ -55,6 +55,9 @@ export const columns = (
cell: ({row}) => { cell: ({row}) => {
const category = categories.find((category) => category.id === row.original.categoryId); const category = categories.find((category) => category.id === row.original.categoryId);
return ( return (
<>
{
category && (
<div className="flex items-center space-x-4"> <div className="flex items-center space-x-4">
<svg className="h-5" fill={category?.color} viewBox="0 0 20 20" <svg className="h-5" fill={category?.color} viewBox="0 0 20 20"
xmlns="http://www.w3.org/2000/svg"> xmlns="http://www.w3.org/2000/svg">
@ -62,6 +65,9 @@ export const columns = (
</svg> </svg>
<p>{category?.name ?? '-'}</p> <p>{category?.name ?? '-'}</p>
</div> </div>
)
}
</>
); );
}, },
size: 200, size: 200,