"use client"; import useSWR from "swr"; import { NezhaAPISafe } from "@/app/[locale]/types/nezha-api"; import { nezhaFetcher } from "@/lib/utils"; import getEnv from "@/lib/env-entry"; import { useRouter } from "next/navigation"; import { useLocale } from "next-intl"; import { BackIcon } from "@/components/Icon"; import { Card, CardContent } from "@/components/ui/card"; import { Badge } from "@/components/ui/badge"; export default function ServerDetailClient({ server_id }: { server_id: number }) { const router = useRouter(); const locale = useLocale(); const { data, error } = useSWR( `/api/detail?server_id=${server_id}`, nezhaFetcher, { refreshInterval: Number(getEnv("NEXT_PUBLIC_NezhaFetchInterval")) || 5000, }, ); return (
{ router.push(`/${locale}/`); }} className="flex flex-none cursor-pointer font-semibold leading-none items-center break-all tracking-tight gap-0.5 text-xl" > HomeDash

ID

{server_id}

Tag

{data?.tag}
) }