Skip to content

Commit 7e4499c

Browse files
committed
Made the type generic
1 parent 4c33aff commit 7e4499c

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

packages/page-primitives/src/badge.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type { ThemeStyle } from "@courselit/page-models";
88

99
export interface BadgeProps extends Omit<ShadcnBadgeProps, "variant"> {
1010
theme?: ThemeStyle;
11-
style?: React.CSSProperties;
11+
style?: Record<string, string>;
1212
variant?: "default" | "secondary" | "destructive" | "outline";
1313
}
1414

@@ -46,11 +46,8 @@ export const Badge: React.FC<BadgeProps> = ({
4646
style={{
4747
...style,
4848
backgroundColor:
49-
(style as React.CSSProperties).backgroundColor ||
50-
theme?.colors?.secondary,
51-
color:
52-
(style as React.CSSProperties).color ||
53-
theme?.colors?.buttonText,
49+
style.backgroundColor || theme?.colors?.secondary,
50+
color: style.color || theme?.colors?.buttonText,
5451
borderColor: theme?.colors?.border,
5552
}}
5653
{...props}

0 commit comments

Comments
 (0)