In the html below, I am optionally applying the bootstrap classes, alert-danger or alert-primary depending on message.error or message.info. The target classes are bootstrap classes and it works as expected.
<div
className={classnames(`alert, ${styles.alertDiv}`, {
"alert-danger": message.error,
"alert-primary": message.info,
})}
>
Now, in place of alert-danger, I want to apply a style from a css file, $(styles.activeDiv) if message.error is true. In other words I want to replace alert-danger with $(styles.activeDiv). How do I do this.