20 lines
581 B
JavaScript
20 lines
581 B
JavaScript
import NodeCard from './NodeCard';
|
|
|
|
/**
|
|
* @param {{ nodes: Array<{ name: string; type: string; cpu: number; memory: { total: number; used: number }; status: string; uptime: number; load: number }> }} props
|
|
* @returns {import('react').ReactNode}
|
|
*/
|
|
export default function NodeList({ nodes }) {
|
|
if (!nodes?.length) {
|
|
return <p className="text-text-secondary text-sm">No nodes found.</p>;
|
|
}
|
|
|
|
return (
|
|
<div className="grid gap-4 sm:grid-cols-2 lg:grid-cols-3">
|
|
{nodes.map((node) => (
|
|
<NodeCard key={node.name} node={node} />
|
|
))}
|
|
</div>
|
|
);
|
|
}
|