mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: add badges to editor
This commit is contained in:
parent
cc68ea2e94
commit
8965ee67c3
7 changed files with 308 additions and 0 deletions
|
|
@ -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>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue