fix: update CheckItem to client component

This commit is contained in:
thehrz 2024-08-19 18:17:47 +08:00
parent 6c9a08e20f
commit f8ee75fb6a
Signed by: thehrz
GPG Key ID: C84CBCE7D5F88855
2 changed files with 5 additions and 3 deletions

View File

@ -1,3 +1,4 @@
"use client"
import { CheckItemIconState, CheckItemType } from "@/types/CheckItem"
import { Icon } from "@iconify/react/dist/iconify.js"
import useSWRImmutable from "swr/immutable"

View File

@ -1,3 +1,4 @@
"use client"
import CheckItem from "./CheckItem"
import { CheckItemType } from "@/types/CheckItem"
@ -8,7 +9,7 @@ const checkList: CheckItemType[] = [
const isIPv6 = data?.version == 6
return {
state: isIPv6 ? "ok" : "error",
text: "公网 IPv6 地址: " + (isIPv6 ? `${data?.address}` : "未检测到")
text: "公网 IPv6 地址: " + (isIPv6 ? `${data?.address}` : "未检测到"),
}
},
},
@ -18,7 +19,7 @@ const checkList: CheckItemType[] = [
const isIPv4 = data?.version == 4
return {
state: isIPv4 ? "ok" : "error",
text: "公网 IPv4 地址: " + (isIPv4 ? `${data?.address}` : "未检测到")
text: "公网 IPv4 地址: " + (isIPv4 ? `${data?.address}` : "未检测到"),
}
},
},
@ -28,7 +29,7 @@ export default function Checker() {
return (
<>
{checkList.map((item, i) => {
return <CheckItem key={i} url={item.url} content={item.content}/>
return <CheckItem key={i} url={item.url} content={item.content} />
})}
</>
)