Skip to content

Commit

Permalink
fix: marketplace TagList render
Browse files Browse the repository at this point in the history
  • Loading branch information
dougfabris committed Aug 1, 2024
1 parent 3e8be51 commit 5268027
Showing 1 changed file with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,20 @@ type TagListProps = {
onClick: CategoryDropDownListProps['onSelected'];
};

const TagList = ({ categories, onClick }: TagListProps) => (
<ButtonGroup wrap small>
{categories.map((category) => (
<Chip flexShrink={0} key={category.id} onClick={(): void => onClick(category)} disabled={undefined} mbe={8}>
{category.label}
</Chip>
))}
</ButtonGroup>
);
const TagList = ({ categories, onClick }: TagListProps) => {
if (!categories.length) {
return null;
}

return (
<ButtonGroup wrap small>
{categories.map((category) => (
<Chip key={category.id} onClick={() => onClick(category)}>
{category.label}
</Chip>
))}
</ButtonGroup>
);
};

export default TagList;

0 comments on commit 5268027

Please sign in to comment.