mirror of
https://github.com/LHY0125/PathEditor.git
synced 2026-06-29 09:55:56 +08:00
48129a8908
完全移除旧 C+IUP 代码,改用 Tauri 2.x + React 19 + TypeScript + Rust 技术栈重写。 功能与 v3.1 完全等价: - React 前端:Tailwind CSS 4、Zustand 状态管理、i18next 国际化 - Rust 后端:winreg 注册表读写、Win32 API FFI 调用 - 核心逻辑:StringList、UndoRedoManager、PathManager、Import/Export - 深色模式、中英文切换、键盘快捷键、合并预览 - 66 个 Vitest 单元测试 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import { useTranslation } from 'react-i18next';
|
|
|
|
interface HelpDialogProps {
|
|
open: boolean;
|
|
onClose: () => void;
|
|
}
|
|
|
|
export function HelpDialog({ open, onClose }: HelpDialogProps) {
|
|
const { t } = useTranslation();
|
|
|
|
if (!open) return null;
|
|
|
|
return (
|
|
<div
|
|
className="fixed inset-0 z-50 flex items-center justify-center"
|
|
style={{ backgroundColor: 'rgba(0,0,0,0.4)' }}
|
|
onClick={onClose}
|
|
>
|
|
<div
|
|
className="rounded-lg p-6 max-w-lg"
|
|
style={{ backgroundColor: 'var(--app-bg)', color: 'var(--app-fg)' }}
|
|
onClick={(e) => e.stopPropagation()}
|
|
>
|
|
<h2 className="text-lg font-semibold mb-4">{t('dialog.helpTitle')}</h2>
|
|
<pre className="text-sm whitespace-pre-wrap font-sans leading-relaxed">
|
|
{t('help.content')}
|
|
</pre>
|
|
<div className="flex justify-end mt-4">
|
|
<button
|
|
className="px-4 py-1.5 text-sm rounded text-white"
|
|
style={{ backgroundColor: '#2563eb' }}
|
|
onClick={onClose}
|
|
>
|
|
{t('dialog.confirm')}
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|