| Total Complexity | 0 |
| Complexity/F | 0 |
| Lines of Code | 26 |
| Function Count | 0 |
| Duplicated Lines | 0 |
| Ratio | 0 % |
| Coverage | 60% |
| Changes | 0 | ||
| 1 | import React from 'react' |
||
| 2 | import PropTypes from 'prop-types' |
||
| 3 | import CKEditor from '@ckeditor/ckeditor5-react' |
||
| 4 | import ClassicEditor from '@ckeditor/ckeditor5-build-classic' |
||
| 5 | |||
| 6 | 1 | const Content = ({ content, editPostContent }) => { |
|
| 7 | 1 | return ( |
|
| 8 | <CKEditor |
||
| 9 | editor={ClassicEditor} |
||
| 10 | data={content} |
||
| 11 | onChange={(_, editor) => { |
||
| 12 | const data = editor.getData() |
||
| 13 | editPostContent(data) |
||
| 14 | }} |
||
| 15 | /> |
||
| 16 | ) |
||
| 17 | } |
||
| 18 | |||
| 19 | export default Content |
||
| 20 | |||
| 21 | 1 | Content.propTypes = { |
|
| 22 | isEdited: PropTypes.bool, |
||
| 23 | content: PropTypes.string, |
||
| 24 | editPostContent: PropTypes.func |
||
| 25 | } |
||
| 26 |