Initial commit
This commit is contained in:
35
src/components/shared/Badge.tsx
Normal file
35
src/components/shared/Badge.tsx
Normal file
@@ -0,0 +1,35 @@
|
||||
"use client";
|
||||
|
||||
import { memo } from "react";
|
||||
import { cls } from "@/lib/utils";
|
||||
|
||||
interface BadgeProps {
|
||||
text: string;
|
||||
variant?: "primary" | "card";
|
||||
className?: string;
|
||||
}
|
||||
|
||||
const Badge = memo(({
|
||||
text,
|
||||
variant = "primary",
|
||||
className = "",
|
||||
}: BadgeProps) => {
|
||||
return (
|
||||
<div className={cls(
|
||||
"px-3 py-1 rounded-theme w-fit",
|
||||
variant === "primary" ? "primary-button" : "card",
|
||||
className
|
||||
)}>
|
||||
<p className={cls(
|
||||
"relative z-1 text-xs",
|
||||
variant === "primary" ? "text-background" : "text-foreground"
|
||||
)}>
|
||||
{text}
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
});
|
||||
|
||||
Badge.displayName = "Badge";
|
||||
|
||||
export default Badge;
|
||||
Reference in New Issue
Block a user