mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 15:55:48 +00:00
feat: add className prop
This commit is contained in:
@@ -5,9 +5,17 @@ import { Color } from '@/types/theme';
|
|||||||
interface StatusBadgeProps {
|
interface StatusBadgeProps {
|
||||||
color: Color;
|
color: Color;
|
||||||
text: string;
|
text: string;
|
||||||
|
className?: {
|
||||||
|
badge?: string;
|
||||||
|
status?: string;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const StatusBadge = ({ color = 'neutral', text }: StatusBadgeProps) => {
|
const StatusBadge = ({
|
||||||
|
color = 'neutral',
|
||||||
|
text,
|
||||||
|
className,
|
||||||
|
}: StatusBadgeProps) => {
|
||||||
return (
|
return (
|
||||||
<Badge
|
<Badge
|
||||||
variant='soft'
|
variant='soft'
|
||||||
@@ -18,8 +26,11 @@ const StatusBadge = ({ color = 'neutral', text }: StatusBadgeProps) => {
|
|||||||
'bg-base-content/5': color === 'neutral',
|
'bg-base-content/5': color === 'neutral',
|
||||||
'bg-success/30': color === 'success',
|
'bg-success/30': color === 'success',
|
||||||
'bg-error/20': color === 'error',
|
'bg-error/20': color === 'error',
|
||||||
}
|
'bg-primary/20': color === 'info',
|
||||||
|
},
|
||||||
|
className?.badge
|
||||||
),
|
),
|
||||||
|
status: cn(className?.status),
|
||||||
}}
|
}}
|
||||||
color={color}
|
color={color}
|
||||||
>
|
>
|
||||||
@@ -31,6 +42,7 @@ const StatusBadge = ({ color = 'neutral', text }: StatusBadgeProps) => {
|
|||||||
'text-base-content/10': color === 'neutral',
|
'text-base-content/10': color === 'neutral',
|
||||||
'text-success': color === 'success',
|
'text-success': color === 'success',
|
||||||
'text-error': color === 'error',
|
'text-error': color === 'error',
|
||||||
|
'text-primary': color === 'info',
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
<circle r='6' cx='6' cy='6' fill='currentColor' />
|
<circle r='6' cx='6' cy='6' fill='currentColor' />
|
||||||
|
|||||||
Reference in New Issue
Block a user