mirror of
https://github.com/hanzoai/cd-ui.git
synced 2026-10-30 20:42:45 +00:00
* feat: New components from Argo Rollotus UI in src/v2 directory Signed-off-by: Remington Breeze <[email protected]>
30 lines
598 B
TypeScript
30 lines
598 B
TypeScript
import * as React from 'react';
|
|
import ThemeDiv from '../theme-div/theme-div';
|
|
|
|
import './alert.scss';
|
|
|
|
export enum AlertType {
|
|
Error = 'error',
|
|
Warning = 'warning',
|
|
Success = 'success',
|
|
}
|
|
|
|
interface AlertProps {
|
|
children: string | string[];
|
|
type: AlertType;
|
|
style?: React.CSSProperties;
|
|
}
|
|
|
|
/**
|
|
* Displays important information in a colored banner
|
|
*/
|
|
export const Alert = (props: AlertProps) => {
|
|
return (
|
|
<ThemeDiv style={props.style} className={`alert alert--${props.type}`}>
|
|
{props.children}
|
|
</ThemeDiv>
|
|
);
|
|
};
|
|
|
|
export default Alert;
|