judge4c/src/features/problems/code/components/toolbar/actions/redo-button.tsx
cfngc4594 3417d2ee49 refactor(editor): consolidate editor toolbar actions into unified structure
- Moved all editor action buttons (copy, format, undo, redo, reset) from `src/components/features/playground/workspace/editor/components/` to new location `src/features/problems/code/components/toolbar/actions/`
- Introduced shared `TooltipButton` component to reduce duplication
- Created centralized `useProblemEditorActions` hook for common editor operations
- Updated imports and exports through new index file
- Maintained all existing functionality while improving code organization
2025-05-07 13:42:08 +08:00

25 lines
706 B
TypeScript

"use client";
import { Redo2 } from "lucide-react";
import { useTranslations } from "next-intl";
import { TooltipButton } from "@/components/tooltip-button";
import { useProblemEditorActions } from "@/features/problems/code/hooks/use-problem-editor-actions";
const RedoButton = () => {
const t = useTranslations("WorkspaceEditorHeader.RedoButton");
const { canExecute, handleRedo } = useProblemEditorActions();
return (
<TooltipButton
tooltipContent={t("TooltipContent")}
onClick={handleRedo}
aria-label={t("TooltipContent")}
disabled={!canExecute}
>
<Redo2 size={16} strokeWidth={2} aria-hidden="true" />
</TooltipButton>
);
};
export { RedoButton };