Files
pse.dev/components/ui/badge.tsx
Kalidou Diagne a972305d4b feat: add dark mode #422 (#466)
* feat: add dark mode #422
2025-06-16 10:34:24 +04:00

19 lines
580 B
TypeScript

import React, { HtmlHTMLAttributes } from "react"
interface BadgeProps extends HtmlHTMLAttributes<HTMLDivElement> {
value?: number | string
}
export default function Badge({ value, children }: BadgeProps) {
if (!value) return <>{children}</>
return (
<div className="relative">
<div className="min-w-4 absolute right-[-5px] top-[-5px] m-auto flex h-4 items-center justify-center rounded-full bg-anakiwa-950 px-[6px] dark:bg-anakiwa-400">
<span className="text-xs text-white dark:text-black">{value}</span>
</div>
{children}
</div>
)
}