PluginContentType.jsx 978B

12345678910111213141516171819202122232425262728293031
  1. import React from 'react'
  2. import PageHtml from '../plugin/ContentType/PageHtml/PageHtml.jsx'
  3. import Thread from '../plugin/ContentType/Thread/Thread.jsx'
  4. import Timeline from './Timeline.jsx'
  5. import {FILE_TYPE} from '../helper.js'
  6. const PluginContentType = props => {
  7. const [leftPart, rightPart] = (() => {
  8. switch (props.file.type) {
  9. case FILE_TYPE[0].name: // pageHtml
  10. return [
  11. <PageHtml version={props.file.version} text={props.file.text} key={'pageHtml'} />,
  12. <Timeline customClass={`${props.customClass}__contentpage`} key={'pageHtml__timeline'} />
  13. ]
  14. case FILE_TYPE[3].name: // thread
  15. return [
  16. <Thread />
  17. ]
  18. }
  19. })()
  20. return [leftPart, rightPart]
  21. // const { componentLeft, componentRight, customClass, } = FILE_TYPE.find(p => p.name === props.file.type)
  22. //
  23. // return [
  24. // genericPlugin.componentLeft,
  25. // genericPlugin.componentRight
  26. // ]
  27. }
  28. export default PluginContentType