Tile windowing system
This commit is contained in:
parent
c6e6c5ca48
commit
43318fb8cd
35 changed files with 4659 additions and 360 deletions
24
app/components/panels/OverviewPanel.tsx
Normal file
24
app/components/panels/OverviewPanel.tsx
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
"use client";
|
||||
|
||||
import { useState, useEffect, useRef } from "react";
|
||||
import { getStats, type Stats, type NetworkInterface } from "../../lib/getStats";
|
||||
import StatsGrid from "../StatsGrid";
|
||||
|
||||
export default function OverviewPanel() {
|
||||
const [stats, setStats] = useState<Stats | null>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const go = async () => {
|
||||
try { setStats(await getStats()); } catch {}
|
||||
};
|
||||
go();
|
||||
const id = setInterval(go, 4000);
|
||||
return () => clearInterval(id);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<div className="p-4 pb-2">
|
||||
<StatsGrid stats={stats} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue