Passed
Push — master ( 6fca9e...82ba0d )
by Huu-Phat
02:25 queued 10s
created

cms/src/post/components/Content.js

Complexity

Total Complexity 0
Complexity/F 0

Size

Lines of Code 26
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 60%

Importance

Changes 0
Metric Value
wmc 0
eloc 20
mnd 0
bc 0
fnc 0
dl 0
loc 26
bpm 0
cpm 0
noi 0
c 0
b 0
f 0
ccs 3
cts 5
cp 0.6
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