feat: add buttons extension blocks

This commit is contained in:
swve 2024-10-10 22:44:56 +02:00
parent 8965ee67c3
commit f2c6687660
5 changed files with 241 additions and 4 deletions

View file

@ -17,6 +17,7 @@ import {
FileText,
ImagePlus,
Lightbulb,
MousePointerClick,
Sigma,
Tag,
Tags,
@ -211,16 +212,31 @@ export const ToolbarButtons = ({ editor, props }: any) => {
onClick={() => editor.chain().focus().insertContent({
type: 'badge',
content: [
{
type: 'text',
text: 'This is a Badge'
}
{
type: 'text',
text: 'This is a Badge'
}
]
}).run()}
>
<Tags size={15} />
</ToolBtn>
</ToolTip>
<ToolTip content={'Button'}>
<ToolBtn
onClick={() => editor.chain().focus().insertContent({
type: 'button',
content: [
{
type: 'text',
text: 'Click me'
}
]
}).run()}
>
<MousePointerClick size={15} />
</ToolBtn>
</ToolTip>
</ToolButtonsWrapper>
)
}