2021-04-26 16:36:41 +00:00
|
|
|
import React from "react"
|
2021-05-24 12:49:59 +00:00
|
|
|
import Style from "./Alert.module.css"
|
2021-04-26 16:36:41 +00:00
|
|
|
import classNames from "classnames"
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A colored alert box to draw the user's attention.
|
|
|
|
*
|
|
|
|
* @param color - The color of the alert.
|
|
|
|
* @param children - The contents of the alert.
|
|
|
|
* @param className - Additional class(es) to add to the div.
|
|
|
|
* @param props - Additional props to pass to the div.
|
|
|
|
* @returns {JSX.Element}
|
|
|
|
* @constructor
|
|
|
|
*/
|
2021-05-24 12:49:59 +00:00
|
|
|
export default function Alert({ color, children, className, ...props }) {
|
2021-04-26 16:36:41 +00:00
|
|
|
return (
|
|
|
|
<div className={classNames(Style.BoxAlert, Style[`BoxAlert${color}`], className)} {...props}>
|
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|