feat: add badges to editor

This commit is contained in:
swve 2024-10-10 22:20:02 +02:00
parent cc68ea2e94
commit 8965ee67c3
7 changed files with 308 additions and 0 deletions

View file

@ -16,7 +16,10 @@ import {
Cuboid,
FileText,
ImagePlus,
Lightbulb,
Sigma,
Tag,
Tags,
Video,
} from 'lucide-react'
import { SiYoutube } from '@icons-pack/react-simple-icons'
@ -203,6 +206,21 @@ export const ToolbarButtons = ({ editor, props }: any) => {
<Cuboid size={15} />
</ToolBtn>
</ToolTip>
<ToolTip content={'Badges'}>
<ToolBtn
onClick={() => editor.chain().focus().insertContent({
type: 'badge',
content: [
{
type: 'text',
text: 'This is a Badge'
}
]
}).run()}
>
<Tags size={15} />
</ToolBtn>
</ToolTip>
</ToolButtonsWrapper>
)
}