mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: add warning custom extension
This commit is contained in:
parent
fe8fdd1769
commit
88644ad902
6 changed files with 99 additions and 9 deletions
|
|
@ -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>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue