mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
25 lines
464 B
TypeScript
25 lines
464 B
TypeScript
"use client";
|
|
|
|
import { IPInfo } from "@/app/api/server-ip/route";
|
|
import { nezhaFetcher } from "@/lib/utils";
|
|
import useSWR from "swr";
|
|
|
|
export default function ServerIPInfo({ server_id }: { server_id: number }) {
|
|
const { data } = useSWR<IPInfo>(
|
|
`/api/server-ip?server_id=${server_id}`,
|
|
nezhaFetcher,
|
|
);
|
|
|
|
if (!data) {
|
|
return <div>Loading...</div>;
|
|
}
|
|
|
|
console.log(data);
|
|
|
|
return (
|
|
<div>
|
|
<h1>Server IP Info</h1>
|
|
</div>
|
|
);
|
|
}
|