trilium/apps/client/src/widgets/buttons/create_pane_button.tsx
2025-09-16 23:05:43 +03:00

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();
}}
/>
)
}