shoc-frontend-new/src/components/ui/count-badge.tsx

23 lines
468 B
TypeScript

import { cn } from "@/lib/utils";
export type CountBadgeProps = {
count: number;
className?: string;
};
export function CountBadge({ count, className }: CountBadgeProps) {
if (count <= 0) {
return null;
}
return (
<span
className={cn(
"inline-flex h-[18px] min-w-[18px] items-center justify-center rounded-full bg-primary px-1.5 text-[10.5px] font-bold text-white",
className,
)}
>
{count}
</span>
);
}