I'm trying to add a class to my Card component, so that I can choose the layout while I'm inserting it. But the props is not interpreted in the className, how can I add a css class this way?
Component
function Card(props) {
return (
<div className="d-flex mx-auto {props.layout}" >
<div className="background my-auto">
<div className="d-flex justify-content-center">
<h3>{props.title}</span></h3>
</div>
<div className="d-flex h-100">
<div className="w-100 my-auto">
<p>{props.text}</p>
</div>
</div>
</div>
</div>
);
}
In Layout
<Card
layout="my-green-bg"
title="my title"
text="my text"
/>