"use client"; import { envConfig } from "@/app/lib/config"; import { useEffect, useState } from "react"; export default function TableEquipos() { const [equipos, setEquipos] = useState([]); const [loading, setLoading] = useState(true); useEffect(() => { console.log("LLAMANDO API EQUIPO"); fetch(`${envConfig.apiUrl}/equipo`) .then((res) => res.json()) .then((data) => { console.log("EQUIPOS:", data); setEquipos(data); setLoading(false); }) .catch((err) => { console.error("ERROR API:", err); setLoading(false); }); }, []); if (loading) { return

Cargando equipos...

; } return (
{equipos.map((eq) => ( ))}
Ubicación Nombre Plataforma Área Activo
{eq.ubicacion} {eq.nombre_equipo} {eq.plataforma?.nombre || eq.id_plataforma} {eq.areaUbicacion?.nombre || eq.id_area_ubicacion} {eq.activo ? "Sí" : "No"}
); }