Skip to content

Commit d71c463

Browse files
committed
add dataset download count
1 parent 9d6badd commit d71c463

File tree

1 file changed

+11
-5
lines changed
  • app/[locale]/(user)/datasets/[datasetIdentifier]/components/PrimaryData

1 file changed

+11
-5
lines changed

app/[locale]/(user)/datasets/[datasetIdentifier]/components/PrimaryData/index.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
'use client';
22

3-
import React, { useState } from 'react';
4-
import Link from 'next/link';
53
import { Button, Icon, Spinner, Tag, Text, Tray } from 'opub-ui';
4+
import React, { useState } from 'react';
65

7-
import { handleRedirect } from '@/lib/utils';
86
import { Icons } from '@/components/icons';
97
import Metadata from '../Metadata';
108

@@ -14,13 +12,21 @@ interface PrimaryDataProps {
1412
}
1513

1614
const PrimaryData: React.FC<PrimaryDataProps> = ({ data, isLoading }) => {
17-
1815
const [open, setOpen] = useState(false);
1916

2017
return (
2118
<div>
2219
<div className="flex flex-col gap-4">
23-
<Text variant="headingLg">{data?.title}</Text>
20+
<div className="flex justify-between gap-2">
21+
<Text variant="headingLg">{data?.title}</Text>
22+
{data.downloadCount > 0 && (
23+
<div className="flex gap-1">
24+
<Text>{data.downloadCount}</Text>
25+
<Icon source={Icons.download} size={18} color="warning" />
26+
</div>
27+
)}
28+
</div>
29+
2430
<div className="flex gap-2">
2531
{data?.tags.map((item: any, index: any) => (
2632
<Tag key={index}>{item.value}</Tag>

0 commit comments

Comments
 (0)