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
+5 -2
View File
@@ -4,6 +4,7 @@ import type { CSSProperties } from "react"
import JsonView from "@uiw/react-json-view"
import { cn } from "@/lib/utils"
import { useI18n } from "@/i18n/provider"
type JsonTreeViewerProps = {
value: unknown
@@ -34,10 +35,12 @@ const viewerTheme = {
export function JsonTreeViewer({
value,
emptyText = "暂无数据",
emptyText,
className,
collapsed = 2,
}: JsonTreeViewerProps) {
const t = useI18n()
if (value == null || value === "") {
return (
<div
@@ -46,7 +49,7 @@ export function JsonTreeViewer({
className
)}
>
{emptyText}
{emptyText ?? t("json.empty")}
</div>
)
}