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,13 +55,19 @@ 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 (
<div className="flex items-center space-x-4"> <>
<svg className="h-5" fill={category?.color} viewBox="0 0 20 20" {
xmlns="http://www.w3.org/2000/svg"> category && (
<circle cx="10" cy="10" r="10"/> <div className="flex items-center space-x-4">
</svg> <svg className="h-5" fill={category?.color} viewBox="0 0 20 20"
<p>{category?.name ?? '-'}</p> xmlns="http://www.w3.org/2000/svg">
</div> <circle cx="10" cy="10" r="10"/>
</svg>
<p>{category?.name ?? '-'}</p>
</div>
)
}
</>
); );
}, },
size: 200, size: 200,