2024-09-19 20:32:24 +02:00
|
|
|
// 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";
|
2024-11-22 01:05:04 +01:00
|
|
|
import "./quicktipsview.scss";
|
2024-09-19 20:32:24 +02:00
|
|
|
|
|
|
|
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));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-10-08 02:20:18 +02:00
|
|
|
function makeQuickTipsViewModel() {
|
2024-09-19 20:32:24 +02:00
|
|
|
return new QuickTipsViewModel();
|
|
|
|
}
|
|
|
|
|
|
|
|
function QuickTipsView({ model }: { model: QuickTipsViewModel }) {
|
|
|
|
return (
|
|
|
|
<div className="quicktips-view">
|
|
|
|
<QuickTips />
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
2024-10-08 02:20:18 +02:00
|
|
|
export { makeQuickTipsViewModel, QuickTipsView, QuickTipsViewModel };
|