refactor: support i18n

This commit is contained in:
mlogclub
2026-05-25 12:06:15 +08:00
parent 309ac1fe9e
commit 988f55c80d
179 changed files with 10968 additions and 3763 deletions
+4 -2
View File
@@ -1,6 +1,7 @@
"use client"
import { cn } from "@/lib/utils"
import { useI18n } from "@/i18n/provider"
type JsonViewerProps = {
value: unknown
@@ -48,9 +49,10 @@ function highlightJson(value: string) {
export function JsonViewer({
value,
emptyText = "暂无数据",
emptyText,
className,
}: JsonViewerProps) {
const t = useI18n()
const formatted = formatJson(value)
if (!formatted) {
return (
@@ -60,7 +62,7 @@ export function JsonViewer({
className
)}
>
{emptyText}
{emptyText ?? t("json.empty")}
</div>
)
}