Files
yaak-mountain-loop/src-web/components/core/CountBadge.tsx
2024-12-19 05:57:40 -08:00

23 lines
542 B
TypeScript

import classNames from 'classnames';
interface Props {
count: number | true;
className?: string;
}
export function CountBadge({ count, className }: Props) {
if (count === 0) return null;
return (
<div
aria-hidden
className={classNames(
className,
'flex items-center',
'opacity-70 border border-border-subtle text-4xs rounded mb-0.5 px-1 ml-1 h-4 font-mono',
)}
>
{count === true ? <div aria-hidden className="rounded-full h-1 w-1 bg-text-subtle" /> : count}
</div>
);
}