mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
feat(FE-40): add Alert component
This commit is contained in:
@@ -0,0 +1,27 @@
|
|||||||
|
import { ReactNode } from 'react';
|
||||||
|
|
||||||
|
import { cn } from '@/lib/helper';
|
||||||
|
|
||||||
|
interface AlertProps {
|
||||||
|
variant?: 'outline' | 'dash' | 'soft';
|
||||||
|
color?: 'info' | 'success' | 'warning' | 'error';
|
||||||
|
children?: ReactNode;
|
||||||
|
className?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
const Alert = ({ children, variant, color, className }: AlertProps) => {
|
||||||
|
const alertBaseClassName = cn('alert', {
|
||||||
|
'alert-soft': variant === 'soft',
|
||||||
|
'alert-outline': variant === 'outline',
|
||||||
|
'alert-dash': variant === 'dash',
|
||||||
|
|
||||||
|
'alert-info': color === 'info',
|
||||||
|
'alert-success': color === 'success',
|
||||||
|
'alert-warning': color === 'warning',
|
||||||
|
'alert-error': color === 'error',
|
||||||
|
});
|
||||||
|
|
||||||
|
return <div className={cn(alertBaseClassName, className)}>{children}</div>;
|
||||||
|
};
|
||||||
|
|
||||||
|
export default Alert;
|
||||||
Reference in New Issue
Block a user