feat: add math extension to editor

This commit is contained in:
swve 2023-02-05 14:26:29 +01:00
parent 1d0ce89aa3
commit 5dacaa4871
7 changed files with 255 additions and 1 deletions

View file

@ -1,6 +1,6 @@
import styled from "styled-components";
import { FontBoldIcon, FontItalicIcon, StrikethroughIcon, ArrowLeftIcon, ArrowRightIcon, OpacityIcon } from "@radix-ui/react-icons";
import { AlertCircle, AlertTriangle, ImagePlus, Info, Video, Youtube } from "lucide-react";
import { AlertCircle, AlertTriangle, ImagePlus, Info, Sigma, Video, Youtube } from "lucide-react";
export const ToolbarButtons = ({ editor }: any) => {
if (!editor) {
@ -90,6 +90,19 @@ export const ToolbarButtons = ({ editor }: any) => {
<ToolBtn onClick={() => addYoutubeVideo()}>
<Youtube size={15} />
</ToolBtn>
<ToolBtn
onClick={() =>
editor
.chain()
.focus()
.insertContent({
type: "blockMathEquation",
})
.run()
}
>
<Sigma size={15} />
</ToolBtn>
</ToolButtonsWrapper>
);
};