mirror of
https://github.com/wavetermdev/waveterm.git
synced 2025-01-06 19:18:22 +01:00
37 lines
936 B
TypeScript
37 lines
936 B
TypeScript
|
// Copyright 2024, Command Line Inc.
|
||
|
// SPDX-License-Identifier: Apache-2.0
|
||
|
|
||
|
import { QuickTips } from "@/app/element/quicktips";
|
||
|
import { globalStore } from "@/app/store/global";
|
||
|
import { Atom, atom, PrimitiveAtom } from "jotai";
|
||
|
import "./quicktipsview.less";
|
||
|
|
||
|
class QuickTipsViewModel implements ViewModel {
|
||
|
viewType: string;
|
||
|
showTocAtom: PrimitiveAtom<boolean>;
|
||
|
endIconButtons: Atom<IconButtonDecl[]>;
|
||
|
|
||
|
constructor() {
|
||
|
this.viewType = "tips";
|
||
|
this.showTocAtom = atom(false);
|
||
|
}
|
||
|
|
||
|
showTocToggle() {
|
||
|
globalStore.set(this.showTocAtom, !globalStore.get(this.showTocAtom));
|
||
|
}
|
||
|
}
|
||
|
|
||
|
function makeHelpViewModel() {
|
||
|
return new QuickTipsViewModel();
|
||
|
}
|
||
|
|
||
|
function QuickTipsView({ model }: { model: QuickTipsViewModel }) {
|
||
|
return (
|
||
|
<div className="quicktips-view">
|
||
|
<QuickTips />
|
||
|
</div>
|
||
|
);
|
||
|
}
|
||
|
|
||
|
export { makeHelpViewModel, QuickTipsView, QuickTipsViewModel };
|