diff --git a/apps/storybook/stories/badge.stories.tsx b/apps/storybook/stories/badge.stories.tsx index 282ca86f..d5c4ee46 100644 --- a/apps/storybook/stories/badge.stories.tsx +++ b/apps/storybook/stories/badge.stories.tsx @@ -48,7 +48,31 @@ export function Variants() { ); } -export function Icon() { +export function StartIcon() { + return ( +
+ + + + + +
+ ); +} + +export function EndIcon() { return (
diff --git a/packages/ui/src/Badge/Badge.tsx b/packages/ui/src/Badge/Badge.tsx index 3c5b2cd6..4b9eaee9 100644 --- a/packages/ui/src/Badge/Badge.tsx +++ b/packages/ui/src/Badge/Badge.tsx @@ -10,6 +10,7 @@ export type BadgeVariant = type Props = Readonly<{ endAddOn?: React.ComponentType>; label: string; + startAddOn?: React.ComponentType>; variant: BadgeVariant; }>; @@ -42,7 +43,12 @@ const classes: Record< }, }; -export default function Badge({ endAddOn: EndAddOn, label, variant }: Props) { +export default function Badge({ + endAddOn: EndAddOn, + label, + startAddOn: StartAddOn, + variant, +}: Props) { const { backgroundClass, textClass } = classes[variant]; return ( @@ -52,6 +58,7 @@ export default function Badge({ endAddOn: EndAddOn, label, variant }: Props) { backgroundClass, textClass, )}> + {StartAddOn &&