mirror of
https://github.com/rzmk/learnhouse.git
synced 2025-12-19 04:19:25 +00:00
feat: add ExternalObjects (Embeds) to editor
This commit is contained in:
parent
b1d05168b6
commit
d8be321021
7 changed files with 279 additions and 2 deletions
|
|
@ -13,12 +13,13 @@ import {
|
|||
AlertTriangle,
|
||||
BadgeHelp,
|
||||
Code,
|
||||
Cuboid,
|
||||
FileText,
|
||||
ImagePlus,
|
||||
Sigma,
|
||||
Video,
|
||||
Youtube,
|
||||
} from 'lucide-react'
|
||||
import { SiYoutube } from '@icons-pack/react-simple-icons'
|
||||
import ToolTip from '@components/StyledElements/Tooltip/Tooltip'
|
||||
|
||||
export const ToolbarButtons = ({ editor, props }: any) => {
|
||||
|
|
@ -139,7 +140,7 @@ export const ToolbarButtons = ({ editor, props }: any) => {
|
|||
</ToolTip>
|
||||
<ToolTip content={'YouTube video'}>
|
||||
<ToolBtn onClick={() => addYoutubeVideo()}>
|
||||
<Youtube size={15} />
|
||||
<SiYoutube size={15} />
|
||||
</ToolBtn>
|
||||
</ToolTip>
|
||||
<ToolTip content={'Math Equation (LaTeX)'}>
|
||||
|
|
@ -195,6 +196,13 @@ export const ToolbarButtons = ({ editor, props }: any) => {
|
|||
<Code size={15} />
|
||||
</ToolBtn>
|
||||
</ToolTip>
|
||||
<ToolTip content={'External Object (Embed)'}>
|
||||
<ToolBtn
|
||||
onClick={() => editor.chain().focus().insertContent({ type: 'blockEmbed' }).run()}
|
||||
>
|
||||
<Cuboid size={15} />
|
||||
</ToolBtn>
|
||||
</ToolTip>
|
||||
</ToolButtonsWrapper>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue