refactor: 统一中文文案并简化组件结构,提升代码可读性
移除 chrome.i18n 后,将各功能页面、布局与工具模块的 UI 文案改为内联中文; 删除冗余注释与过度抽象(如 ToolCard、StatCard),精简 props 与状态管理; 同步优化 JsonTools、StorageCleaner、Timestamp、TestDataGenerator、Dashboard、 Base64Converter、RightClickRestorer、TextStatistics、TopBar、RouterProvider、 ThemeModeProvider 及生成器库与 utils 工具文件。
This commit is contained in:
@@ -2,7 +2,7 @@ import { Button } from '@/components/ui/button';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { Badge } from '@/components/ui/badge';
|
||||
import { Loader2 } from 'lucide-react';
|
||||
import { CARD_CLASS, DOMAIN_LABEL, LOADING_TEXT, STATUS_CONFIG } from './constants';
|
||||
import { CARD_CLASS, STATUS_CONFIG } from './constants';
|
||||
import { useRightClickRestorer } from './useRightClickRestorer';
|
||||
|
||||
export default function Index() {
|
||||
@@ -13,7 +13,7 @@ export default function Index() {
|
||||
<div className="flex flex-col items-center justify-center py-12 min-h-[280px] w-full">
|
||||
<Loader2 className="h-6 w-6 text-muted-foreground/80 animate-spin" />
|
||||
<span className="text-xs text-muted-foreground mt-2 font-medium tracking-wide">
|
||||
{LOADING_TEXT}
|
||||
正在加载...
|
||||
</span>
|
||||
</div>
|
||||
);
|
||||
@@ -24,9 +24,9 @@ export default function Index() {
|
||||
const ButtonIcon = config.buttonIcon;
|
||||
|
||||
return (
|
||||
<div className="p-4 w-full flex flex-col space-y-4">
|
||||
<div className="p-4 w-full">
|
||||
<div className={CARD_CLASS}>
|
||||
<Label className="text-sm font-medium">{DOMAIN_LABEL}</Label>
|
||||
<Label className="text-sm font-medium">当前域名</Label>
|
||||
<div className="flex items-center justify-between gap-2">
|
||||
<code className="text-sm bg-muted px-2 py-1 rounded truncate min-w-0 flex-1">
|
||||
{domain || '—'}
|
||||
@@ -42,7 +42,7 @@ export default function Index() {
|
||||
className="w-full gap-2"
|
||||
disabled={config.buttonDisabled}
|
||||
variant={config.buttonVariant}
|
||||
onClick={config.buttonDisabled ? undefined : () => void unlock()}
|
||||
onClick={() => void unlock()}
|
||||
>
|
||||
<ButtonIcon className="h-4 w-4" />
|
||||
{config.buttonLabel}
|
||||
|
||||
Reference in New Issue
Block a user