diff --git a/packages/ui/components/badge/Badge.tsx b/packages/ui/components/badge/Badge.tsx index eba2054b83..3d047ba36c 100644 --- a/packages/ui/components/badge/Badge.tsx +++ b/packages/ui/components/badge/Badge.tsx @@ -40,13 +40,16 @@ type IconOrDot = | { startIcon?: IconName; withDot?: never; + customDot?: never; } - | { startIcon?: never; withDot?: true }; + | { startIcon?: never; withDot?: true; customDot?: never } + | { startIcon?: never; withDot?: never; customDot?: React.ReactNode }; export type BadgeBaseProps = InferredBadgeStyles & { children: React.ReactNode; rounded?: boolean; customStartIcon?: React.ReactNode; + customDot?: React.ReactNode; } & IconOrDot; export type BadgeProps = @@ -69,6 +72,7 @@ export const Badge = function Badge(props: BadgeProps) { withDot, children, rounded, + customDot, ...passThroughProps } = props; const isButton = "onClick" in passThroughProps && passThroughProps.onClick !== undefined; @@ -81,10 +85,19 @@ export const Badge = function Badge(props: BadgeProps) { const Children = () => ( <> - {withDot ? : null} + {withDot ? ( + + + + ) : null} {customStartIcon || (StartIcon ? ( - + ) : null)} {children}