diff --git a/src-tauri/src/error.rs b/src-tauri/src/error.rs index ec8950c..97ca0e5 100644 --- a/src-tauri/src/error.rs +++ b/src-tauri/src/error.rs @@ -1,6 +1,7 @@ use serde::Serialize; -/// 传给前端的统一错误类型(保留供未来使用,当前命令返回 Result) +/// 传给前端的统一错误类型(保留供未来迁移使用,届时所有命令改为返回 Result) +#[allow(dead_code)] #[derive(Debug, Serialize)] pub struct AppError { pub message: String, diff --git a/src/components/toolbar/ActionButtons.tsx b/src/components/toolbar/ActionButtons.tsx index ccfb686..535c35c 100644 --- a/src/components/toolbar/ActionButtons.tsx +++ b/src/components/toolbar/ActionButtons.tsx @@ -1,5 +1,6 @@ import { useTranslation } from 'react-i18next'; import { useAppStore } from '@/store/app-store'; +import { btnClass, btnStyle } from '@/components/ui/buttons'; interface ActionButtonsProps { onNew: () => void; @@ -24,14 +25,6 @@ export function ActionButtons({ const isAdmin = useAppStore((s) => s.isAdmin); const disabled = !isAdmin; - const btnClass = - 'px-3 py-1 text-sm rounded border transition-colors disabled:opacity-40 disabled:cursor-not-allowed'; - const btnStyle = { - backgroundColor: 'var(--app-bg)', - color: 'var(--app-fg)', - borderColor: 'var(--app-border)', - }; - return (
- - - - -
diff --git a/src/components/toolbar/UndoRedoButtons.tsx b/src/components/toolbar/UndoRedoButtons.tsx index dcb007b..9a977fd 100644 --- a/src/components/toolbar/UndoRedoButtons.tsx +++ b/src/components/toolbar/UndoRedoButtons.tsx @@ -1,5 +1,6 @@ import { useTranslation } from 'react-i18next'; import { useAppStore } from '@/store/app-store'; +import { btnClass, btnStyle } from '@/components/ui/buttons'; export function UndoRedoButtons() { const { t } = useTranslation(); @@ -8,14 +9,6 @@ export function UndoRedoButtons() { const undo = useAppStore((s) => s.undo); const redo = useAppStore((s) => s.redo); - const btnClass = - 'px-3 py-1 text-sm rounded border transition-colors disabled:opacity-40 disabled:cursor-not-allowed'; - const btnStyle = { - backgroundColor: 'var(--app-bg)', - color: 'var(--app-fg)', - borderColor: 'var(--app-border)', - }; - return (