Supporting icons with ValidationMessages

This commit is contained in:
Belén Curcio
2018-09-07 12:54:22 -03:00
parent 994b0f7fb3
commit b37ec2b944
@@ -14,13 +14,22 @@ export interface ValidationMessageProps {
* If set renders a full width message
*/
fullWidth?: boolean;
/*
* Name of the icon, if not provided it will default to warning icon
*/
icon?: string;
}
const ValidationMessage: StatelessComponent<ValidationMessageProps> = props => {
const { className, fullWidth, children, ...rest } = props;
const { className, fullWidth, children, icon, ...rest } = props;
return (
<Message color="validation" icon="warning" className={className} {...rest}>
<Message
color="validation"
icon={icon ? icon : "warning"}
className={className}
{...rest}
>
{children}
</Message>
);