Skip to content

Commit

Permalink
fix: Do not show empty tags
Browse files Browse the repository at this point in the history
  • Loading branch information
bprusinowski committed Oct 12, 2023
1 parent f91b01e commit 96521d6
Showing 1 changed file with 28 additions and 26 deletions.
54 changes: 28 additions & 26 deletions app/components/dataset-metadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,33 +182,35 @@ const DatasetTags = ({
<Trans id="dataset-preview.keywords">Keywords</Trans>
</DatasetMetadataTitle>
<Stack spacing={1} direction="column" sx={{ mt: 3 }}>
{[cube.creator, ...cube.themes].filter(truthy).map((t) => (
<NextLink
key={t.iri}
href={`/browse/${
t.__typename === "DataCubeTheme" ? "theme" : "organization"
}/${encodeURIComponent(t.iri)}`}
passHref
legacyBehavior
>
<Tag
component={MUILink}
// @ts-ignore
underline="none"
type={t.__typename}
title={t.label || undefined}
sx={{
maxWidth: "100%",
display: "flex",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
overflow: "hidden",
}}
{[cube.creator, ...cube.themes].filter(truthy).map((t) =>
t.label ? (
<NextLink
key={t.iri}
href={`/browse/${
t.__typename === "DataCubeTheme" ? "theme" : "organization"
}/${encodeURIComponent(t.iri)}`}
passHref
legacyBehavior
>
{t.label}
</Tag>
</NextLink>
))}
<Tag
component={MUILink}
// @ts-ignore
underline="none"
type={t.__typename}
title={t.label || undefined}
sx={{
maxWidth: "100%",
display: "flex",
whiteSpace: "nowrap",
textOverflow: "ellipsis",
overflow: "hidden",
}}
>
{t.label}
</Tag>
</NextLink>
) : null
)}
</Stack>
</>
);
Expand Down

0 comments on commit 96521d6

Please sign in to comment.