Files
aiops/frontend/src/components/layout/PageEmpty.tsx
T
attacker 63e4c220d4 feat(i18n): 增量国际化迁移 — deploy/kubernetes/monitor/task 全模块 + 补全 28 缺失翻译键
迁移范围:
- deploy 模块 (PipelineEditor/PipelineDetailDialog/PipelineFormDialog/PipelineRunDialog/ReleaseCreateDialog/ReleaseDetailDialog/ReleaseManager/ToolConfigTab/JobRoleCreateDialog 等 14 文件)
- kubernetes 模块 (YamlEditorToolbar/DeploymentHpaTab/DeploymentLogsTab/DeploymentPodsTab/DnsHostSection/SchedulingSection/EventsTab/HPACronHPATab/HistoryTab/PodsTab/ServicesTab/ActionModals 等 12 文件)
- monitor 模块 (AlertEventsTab/AlertCenterDetail/DatasourcePage/LogAlertBell/LogCenter/LogCenterArchBanner/StatChartPanel/LogRoleCreateDialog 等 8 文件)
- task 模块 (CronJobStatsPanel/CronJobTable/CronJobViewDialog/ExecutionHistoryDialog 4 文件)
- layout (PageEmpty/PageLoading 2 文件)
- site-monitor/snmp-monitor 模块 (6 文件)

翻译键: 3975 → 4003 (+28 缺失键补全), 22 命名空间, zh-CN/en-US 完全对齐
新增命名空间: agent/aiops/cloud/kubernetes/monitor/pipeline/rbac/system/task/ui

验证: go build✅ tsc -b=0 npm build✅ (20.78s) 17/17 集成测试通过
2026-07-02 12:39:36 +08:00

31 lines
936 B
TypeScript

// 页面级空状态 // Logan.Li
import type { ReactNode } from 'react';
import { useTranslation } from 'react-i18next';
import { cn } from '@/lib/utils';
interface PageEmptyProps {
icon?: ReactNode;
title?: string;
description?: string;
action?: ReactNode;
className?: string;
}
export function PageEmpty({
icon,
title,
description,
action,
className,
}: PageEmptyProps) {
const { t } = useTranslation();
const resolvedTitle = title ?? t('common.noData');
return (
<div className={cn('flex flex-col items-center justify-center py-16 text-center', className)}>
{icon && <div className="mb-3 opacity-40 text-[var(--text-tertiary)]">{icon}</div>}
<p className="text-sm font-medium text-[var(--text-primary)]">{resolvedTitle}</p>
{description && <p className="text-sm dg-text-muted mt-1 max-w-sm">{description}</p>}
{action && <div className="mt-4">{action}</div>}
</div>
);
}