import React, { useEffect, useState } from "react"; import "./App.css"; // importiamo lo stile CSS function AppGrid() { const [apps, setApps] = useState([]); useEffect(() => { fetch("/apps") .then(res => res.json()) .then(data => setApps(Array.isArray(data) ? data : [])) .catch(() => setApps([])); }, []); return (
{apps.map(app => (
window.open(`http://${app.host}:${app.port}`, "_blank")} > {app.name}
{app.name}
))}
); } export default AppGrid;