I'm learning reactjs and I want to change the color of a badge component depending on the value of a record that I call from the database through an API. However, when I try to do this it shows me nothing when I run it, do you know what I am missing or how I can do it?
<tbody>
{this.state.SociosData.map((e, key) => {
return (
<tr className="trTable">
<td>
<b>{e.nombre_tienda}</b>{" "}
<p className="mt-3 ">
{e.id_tienda} | {e.tipo_tienda} | Area {e.area_tienda}
</p>
<p>{e.direccion_tienda}</p>
</td>
<td>
{() => {
if (e.estatusfirma_tienda === "Aprobado") {
return <Badge bg="success">Firmado</Badge>;
} else if (e.estatusfirma_tienda === "Rechazado") {
return <Badge bg="danger">Firmado</Badge>;
} else {
return <Badge bg="warning">Firmado</Badge>;
}
}}
{() => {
if (e.estadolinea_tienda === "Activo") {
return <Badge bg="success">Activo</Badge>;
} else {
return (
<Badge bg="light" text="dark">
Inactivo
</Badge>
);
}
}}
</td>
<ModalFirma></ModalFirma>
</tr>
);
})}
</tbody>