Skip to content

Commit 37119c3

Browse files
committed
refactor(ListingComponent): add Geography metadata to MetadataContent for improved dataset information
1 parent f8b16ae commit 37119c3

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

app/[locale]/(user)/components/ListingComponent.tsx

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -477,6 +477,9 @@ const ListingComponent: React.FC<ListingProps> = ({
477477
: item?.organization?.logo
478478
? `${process.env.NEXT_PUBLIC_BACKEND_URL}/${item.organization.logo}`
479479
: '/org.png';
480+
const Geography = item.metadata.filter(
481+
(item: any) => item.metadata_item.label === 'Geography'
482+
)[0]?.value;
480483

481484
const MetadataContent = [
482485
{
@@ -491,13 +494,15 @@ const ListingComponent: React.FC<ListingProps> = ({
491494
value: item.download_count.toString(),
492495
tooltip: 'Download',
493496
},
494-
{
497+
];
498+
if (Geography) {
499+
MetadataContent.push({
495500
icon: Icons.globe,
496501
label: 'Geography',
497-
value: 'India',
502+
value: Geography,
498503
tooltip: 'Geography',
499-
},
500-
];
504+
});
505+
}
501506

502507
if (item.has_charts && view === 'expanded') {
503508
MetadataContent.push({
@@ -508,7 +513,7 @@ const ListingComponent: React.FC<ListingProps> = ({
508513
});
509514
}
510515

511-
const FooterContent = [
516+
const FooterContent = [
512517
{
513518
icon: `/Sectors/${item.sectors[0]}.svg`,
514519
label: 'Sectors',

0 commit comments

Comments
 (0)