mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-17 23:12:23 +00:00
- 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
25 lines
706 B
TypeScript
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 };
|