"use client"; import { ServerApi } from "@/app/types/nezha-api"; import ServerCard from "@/components/ServerCard"; import { nezhaFetcher } from "@/lib/utils"; import useSWR from "swr"; export default function ServerListClient() { const { data } = useSWR("/api/server", nezhaFetcher, { refreshInterval: 3000, }); if (!data) return null; const sortedResult = data.result.sort((a, b) => a.id - b.id); return (
{sortedResult.map((serverInfo) => ( ))}
); }