Skip to content

Commit

Permalink
chore(app): add endIcon prop to Tag (#3281)
Browse files Browse the repository at this point in the history
* add endIcon prop to Tag

* lint
  • Loading branch information
ibindlish authored Dec 18, 2024
1 parent efed3f0 commit a24512a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions weave-js/src/components/Tag/Tag.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ export type TagProps = {
color?: TagColorName;
showIcon?: boolean;
iconName?: IconName;
endIconName?: IconName;
// Wrapping the Tag in Tailwind can be a problem if the Tailwind wrapper is supplied higher up
// and there is a need to position the Tag as a direct child for something like flexbox
Wrapper?: React.ComponentType<any> | null;
Expand All @@ -64,6 +65,7 @@ export const Tag: FC<TagProps> = ({
color,
showIcon = false,
iconName,
endIconName,
Wrapper = Tailwind,
isInteractive = false,
}) => {
Expand All @@ -79,6 +81,7 @@ export const Tag: FC<TagProps> = ({
<span className="max-w-[24ch] overflow-hidden text-ellipsis whitespace-nowrap">
{label}
</span>
{endIconName && <Icon className="ml-4 h-14 w-14" name={endIconName} />}
</div>
);
if (Wrapper) {
Expand Down

0 comments on commit a24512a

Please sign in to comment.