mirror of
https://github.com/zadam/trilium.git
synced 2025-11-16 13:34:30 +01:00
22 lines
699 B
TypeScript
22 lines
699 B
TypeScript
import { useContext } from "preact/hooks";
|
|
import { t } from "../../services/i18n.js";
|
|
import ActionButton from "../react/ActionButton.jsx";
|
|
import { ParentComponent } from "../react/react_utils.jsx";
|
|
import BasicWidget from "../basic_widget.js";
|
|
|
|
export default function CreatePaneButton() {
|
|
const widget = useContext(ParentComponent) as BasicWidget | undefined;
|
|
|
|
return (
|
|
<ActionButton
|
|
icon="bx bx-dock-right"
|
|
text={t("create_pane_button.create_new_split")}
|
|
onClick={(e) => {
|
|
widget?.triggerCommand("openNewNoteSplit", { ntxId: widget.getClosestNtxId() });
|
|
e.stopPropagation();
|
|
}}
|
|
/>
|
|
)
|
|
}
|
|
|