Skip to content

Commit 5d2b82f

Browse files
committed
chip count design
1 parent 78fee63 commit 5d2b82f

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
@reference "../../../styles/index.css";
2+
3+
.chipCount {
4+
@apply mr-1
5+
rounded-sm
6+
bg-gray-800/20
7+
px-1.5;
8+
}

apps/site/components/MDX/EOL/VulnerabilityChips.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import type { FC } from 'react';
33

44
import type { Vulnerability } from '#site/next-data/providers/vulnerabilities.js';
55

6+
import styles from './VulnerabilityChips.module.css';
7+
68
// Mapping of vulnerability severities to UI labels and colors
79
// TODO @bmuenzenmeyer we need i18n keys for these labels
810
const SEVERITY_CONFIG = {
@@ -35,8 +37,8 @@ export const VulnerabilityChip: FC<VulnerabilityChipProps> = ({
3537
return (
3638
// TODO @bmuenzenmeyer we dont like to use classnames like this
3739
<Badge size="small" kind={kind} className="mr-0.5">
40+
{count > 0 ? <span className={styles.chipCount}>{count}</span> : null}
3841
{label}
39-
{count > 0 ? ` (${count})` : null}
4042
</Badge>
4143
);
4244
};

0 commit comments

Comments
 (0)