/* global */
import React from 'react' // eslint-disable-line
import ReactDOM from 'react-dom'
import * as packageJson from '../../../../../../package.json'
import { ViewPlugin } from '@remixproject/engine-web'
import { RemixUiHomeTab } from '@remix-ui/home-tab' // eslint-disable-line

const profile = {
  name: 'home',
  displayName: 'Home',
  methods: [],
  events: [],
  description: ' - ',
  icon: 'assets/img/bricks.png',
  location: 'mainPanel',
  version: packageJson.version
}
export class LandingPage extends ViewPlugin {
  constructor (appManager, verticalIcons, fileManager, filePanel, contentImport) {
    super(profile)
    this.profile = profile
    this.fileManager = fileManager
    this.filePanel = filePanel
    this.contentImport = contentImport
    this.appManager = appManager
    this.verticalIcons = verticalIcons
    this.el = document.createElement('div')
    this.el.setAttribute('id', 'landingPageHomeContainer')
    this.el.setAttribute('class', 'remixui_homeContainer justify-content-between bg-light d-flex')
    this.el.setAttribute('data-id', 'landingPageHomeContainer')
  }

  render () {
    this.renderComponent()
    return this.el
  }

  renderComponent () {
    ReactDOM.render(
      <RemixUiHomeTab
        plugin={this}
      />
      , this.el)
  }
}
