omnivore/packages/web/components/patterns/MDEditorSavePlugin.tsx
Raphaël Barbazza c6a899bc8a
Some checks failed
Build Docker Images / Build docker images (push) Has been cancelled
Build Self-Hosting Docker Images / Build self-host docker images (push) Has been cancelled
Run tests / Run Codebase tests (push) Has been cancelled
Run tests / Build docker images (push) Has been cancelled
Enable HTML mode toggle (#4442)
2025-02-14 16:06:29 +01:00

37 lines
879 B
TypeScript

/* eslint-disable functional/no-class */
import { FloppyDisk } from '@phosphor-icons/react'
import { PluginComponent } from 'react-markdown-editor-lite'
import { Button } from '../elements/Button'
export default class MDEditorSavePlugin extends PluginComponent {
static pluginName = 'save'
static align = 'right'
constructor(props: any) {
super(props)
}
render() {
return (
<Button
style="plainIcon"
css={{
alignItems: 'center',
display: 'flex',
height: '28px',
justifyContent: 'center',
lineHeight: '28px',
minWidth: '24px',
}}
onClick={(event) => {
document.dispatchEvent(new Event('saveMarkdownNote'))
event.preventDefault()
}}
>
<FloppyDisk size={18} weight="bold" color="#757575" />
</Button>
)
}
}