mirror of
https://github.com/privacy-scaling-explorations/pse.dev.git
synced 2026-01-12 15:48:19 -05:00
19 lines
545 B
TypeScript
19 lines
545 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]">
|
|
<span className="text-xs text-white">{value}</span>
|
|
</div>
|
|
{children}
|
|
</div>
|
|
)
|
|
}
|