I am trying to create a reusable tag component and based on company will apply the correct background and text color.
const colorMapping = {
facebook: "white"
}
const backgroundMapping = {
facebook: "blue"
}
export const App = (props) => {
return (
<div style={{ backgroundColor: "", color: "" }}>
{props.company} //Facebook
</div>
)
}
How can I apply the color based on the based string? and Is this the right approach, could I just use 1 mapping object?