2025-06-13 06:03:17 +00:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
import { Actions } from "flexlayout-react";
|
|
|
|
import { BookOpenIcon } from "lucide-react";
|
|
|
|
import { Button } from "@/components/ui/button";
|
2025-06-20 08:39:47 +00:00
|
|
|
import { useProblemFlexLayoutStore } from "@/stores/flexlayout";
|
2025-06-13 06:03:17 +00:00
|
|
|
|
|
|
|
export const ViewSolutionButton = () => {
|
|
|
|
const { model } = useProblemFlexLayoutStore();
|
|
|
|
|
|
|
|
const handleClick = () => {
|
|
|
|
if (!model) return;
|
|
|
|
model.doAction(Actions.selectTab("solution"));
|
|
|
|
};
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Button variant="outline" onClick={handleClick}>
|
|
|
|
<BookOpenIcon />
|
|
|
|
查看题解
|
|
|
|
</Button>
|
|
|
|
);
|
|
|
|
};
|