File size: 540 Bytes
b2d4d0e
 
 
65949d0
b2d4d0e
 
 
 
 
 
 
65949d0
 
 
 
 
 
b2d4d0e
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { useEffect, useState } from "react";

export default function DeviceBadge() {
  const [device, setDevice] = useState<string>("…");
  useEffect(() => {
    fetch("/api/health")
      .then((r) => r.json())
      .then((d) => setDevice(d.device))
      .catch(() => setDevice("offline"));
  }, []);
  return (
    <div className="flex items-center gap-2">
      <span className="label-mono">device</span>
      <span className="font-mono text-[12px] tracking-wider text-foreground">
        {device}
      </span>
    </div>
  );
}