mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-17 23:12:23 +00:00
refactor(redo-button): replace useCodeEditorStore with useProblemEditor in RedoButton component
This commit is contained in:
parent
5db172fce3
commit
547c458a20
@ -8,10 +8,10 @@ import {
|
|||||||
} from "@/components/ui/tooltip";
|
} from "@/components/ui/tooltip";
|
||||||
import { Redo2 } from "lucide-react";
|
import { Redo2 } from "lucide-react";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { useCodeEditorStore } from "@/store/useCodeEditorStore";
|
import { useProblemEditor } from "@/hooks/use-problem-editor";
|
||||||
|
|
||||||
export default function RedoButton() {
|
export function RedoButton() {
|
||||||
const { editor } = useCodeEditorStore();
|
const { editor } = useProblemEditor();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<TooltipProvider delayDuration={0}>
|
<TooltipProvider delayDuration={0}>
|
||||||
@ -24,6 +24,7 @@ export default function RedoButton() {
|
|||||||
onClick={() => {
|
onClick={() => {
|
||||||
editor?.trigger("redo", "redo", null);
|
editor?.trigger("redo", "redo", null);
|
||||||
}}
|
}}
|
||||||
|
disabled={!editor}
|
||||||
className="h-6 w-6 px-1.5 py-0.5 border-none shadow-none hover:bg-muted"
|
className="h-6 w-6 px-1.5 py-0.5 border-none shadow-none hover:bg-muted"
|
||||||
>
|
>
|
||||||
<Redo2 size={16} strokeWidth={2} aria-hidden="true" />
|
<Redo2 size={16} strokeWidth={2} aria-hidden="true" />
|
||||||
|
Loading…
Reference in New Issue
Block a user