judge4c/src/features/problems/detail/components/view-solution-button.tsx
2025-06-21 12:43:16 +08:00

23 lines
550 B
TypeScript

"use client";
import { Actions } from "flexlayout-react";
import { BookOpenIcon } from "lucide-react";
import { Button } from "@/components/ui/button";
import { useProblemFlexLayoutStore } from "@/stores/flexlayout";
export const ViewSolutionButton = () => {
const { model } = useProblemFlexLayoutStore();
const handleClick = () => {
if (!model) return;
model.doAction(Actions.selectTab("solution"));
};
return (
<Button variant="outline" onClick={handleClick}>
<BookOpenIcon />
</Button>
);
};