feat: add onClick prop and set text type to react node

This commit is contained in:
ValdiANS
2026-02-06 09:43:56 +07:00
parent f0637e2ce9
commit 8fb16903f8
+7 -1
View File
@@ -1,24 +1,30 @@
import { ReactNode } from 'react';
import Badge from '@/components/Badge'; import Badge from '@/components/Badge';
import { cn } from '@/lib/helper'; import { cn } from '@/lib/helper';
import { Color } from '@/types/theme'; import { Color } from '@/types/theme';
interface StatusBadgeProps { interface StatusBadgeProps {
color: Color; color: Color;
text: string; text: ReactNode;
className?: { className?: {
badge?: string; badge?: string;
status?: string; status?: string;
}; };
onClick?: () => void;
} }
const StatusBadge = ({ const StatusBadge = ({
color = 'neutral', color = 'neutral',
text, text,
className, className,
onClick,
}: StatusBadgeProps) => { }: StatusBadgeProps) => {
return ( return (
<Badge <Badge
variant='soft' variant='soft'
onClick={onClick}
className={{ className={{
badge: cn( badge: cn(
'px-2 py-1 w-full flex flex-row justify-start gap-1 rounded-lg border border-base-content/10 text-xs font-medium text-base-content', 'px-2 py-1 w-full flex flex-row justify-start gap-1 rounded-lg border border-base-content/10 text-xs font-medium text-base-content',