mirror of
https://github.com/cfngc4594/monaco-editor-lsp-next.git
synced 2025-07-04 17:30:52 +00:00
23 lines
558 B
TypeScript
23 lines
558 B
TypeScript
|
"use client";
|
||
|
|
||
|
import { Actions } from "flexlayout-react";
|
||
|
import { BookOpenIcon } from "lucide-react";
|
||
|
import { Button } from "@/components/ui/button";
|
||
|
import { useProblemFlexLayoutStore } from "@/stores/problem-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>
|
||
|
);
|
||
|
};
|