feat: add warning custom extension

This commit is contained in:
swve 2022-12-08 10:31:43 +01:00
parent fe8fdd1769
commit 88644ad902
6 changed files with 99 additions and 9 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 { AlertTriangle, Info } from "lucide-react";
import { AlertCircle, AlertTriangle, Info } from "lucide-react";
export const ToolbarButtons = ({ editor }: any) => {
if (!editor) {
@ -33,9 +33,12 @@ export const ToolbarButtons = ({ editor }: any) => {
<option value="6">Heading 6</option>
</ToolSelect>
{/* TODO: fix this : toggling only works one-way */}
<ToolBtn onClick={() => editor.chain().focus().toggleNode('calloutInfo').run()} >
<ToolBtn onClick={() => editor.chain().focus().toggleNode('calloutWarning').run()} >
<AlertTriangle size={15} />
</ToolBtn>
<ToolBtn onClick={() => editor.chain().focus().toggleNode('calloutInfo').run()} >
<AlertCircle size={15} />
</ToolBtn>
</ToolButtonsWrapper>
);
};