diff --git a/app/[locale]/(user)/datasets/components/Card/index.tsx b/app/[locale]/(user)/datasets/components/Card/index.tsx index 740c8815..66d2a296 100644 --- a/app/[locale]/(user)/datasets/components/Card/index.tsx +++ b/app/[locale]/(user)/datasets/components/Card/index.tsx @@ -1,8 +1,9 @@ import { useEffect, useRef, useState } from 'react'; import Link from 'next/link'; -import { Button, Tag, Text, Tooltip } from 'opub-ui'; +import { Button, Icon, Tag, Text, Tooltip } from 'opub-ui'; import { formatDateString } from '@/lib/utils'; +import { Icons } from '@/components/icons'; interface MetadataItem { label: string; @@ -19,6 +20,7 @@ interface Dataset { tags: string[]; categories: string[]; formats: string[]; + has_charts: boolean, title: string; description: string; created: string; // ISO 8601 date string @@ -27,8 +29,6 @@ interface Dataset { } const Cards = ({ data }: { data: Dataset }) => { - - function getMetadataValue(data: Dataset, label: string): string | null { const metadataEntry = data.metadata.find( (entry) => entry.metadata_item.label === label @@ -109,7 +109,6 @@ const Cards = ({ data }: { data: Dataset }) => { {getMetadataValue(data, 'Update Frequency') || 'NA'} - @@ -147,29 +146,35 @@ const Cards = ({ data }: { data: Dataset }) => { -
- {data.formats?.length > 0 && ( - - {data.formats.map((fileType, index) => ( - - - {fileType} - - ))} - - )} +
+
+ {data.formats?.length > 0 && ( + + {data.formats.map((fileType, index) => ( + + {fileType} + + ))} + + )} + + {data.has_charts && } +
{data?.categories.length > 0 && ( - + {data?.categories.map((category, index) => ( -
- {category} -
- +
+ {category} +
))}
)} diff --git a/components/icons.tsx b/components/icons.tsx index 9a365688..a084c14e 100644 --- a/components/icons.tsx +++ b/components/icons.tsx @@ -40,6 +40,7 @@ import { IconUserCog, IconUsers, IconX, + IconChartBar // TablerIconsProps, } from '@tabler/icons-react'; @@ -88,4 +89,5 @@ export const Icons: { userSettings: IconUserCog, arrowDiagonal: IconArrowsDiagonal, verticalDots: IconDotsVertical, + chart:IconChartBar };