Add Badge component and use it for performance page ratings
This commit is contained in:
1 parent
4aa5f8411e
commit
31f322630d
4 files changed
+110
-16
No files matched your search
@@ -0,0 +1,16 @@
|
||||
import styles from './Badge.module.css';
|
||||
|
||||
export interface BadgeProps {
|
||||
variant: 'good' | 'warning' | 'danger' | 'gray';
|
||||
children: React.ReactNode;
|
||||
dot?: boolean;
|
||||
}
|
||||
|
||||
export function Badge({ variant, children, dot = true }: BadgeProps) {
|
||||
return (
|
||||
<span className={`${styles.badge} ${styles[variant]}`}>
|
||||
{dot && <span className={styles.dot} />}
|
||||
{children}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user