Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const AlertBody = ({ title, className, children, onClose, closeButtonAriaLabel, ...props }) => (
<div>
{onClose && (
<button aria-label="{closeButtonAriaLabel}">
</button>
)}
{title && <h4>{title}</h4>}
{children && <p>{children}</p>}
</div>
);
...props
}) => {
variantLabel = variantLabel || capitalize(AlertVariant[variant]);
const readerTitle = (
<span>{`${variantLabel} alert:`}</span>
{title}
);
const customClassName = css(styles.alert, getModifier(styles, variant, styles.modifiers.info), className);
return (
<div aria-label="{ariaLabel}">
<h4>{readerTitle}</h4>
{children && (
<div>
<p>{children}</p>
</div>
)}
{action && (
<div>{React.cloneElement(action, { title, variantLabel })}</div>
)}
</div>
);
};