import { h, Component } from 'preact'
import { isMobile } from '../util'
import db from '../db'
import { Lethargy } from 'lethargy'
import { Link } from 'react-router-dom'

import Scroller from './Scroller'

export default class App extends Component {
  constructor() {
    super()
    this.state = {
      data: db.backupDB,
    }
    db.fetch( data => {
      document.body.parentNode.classList.remove('loading')
      this.setState({ data }) 
    })
  }
  render() {
    return (
      <div>
        <div class='header'>Procedural Paintings by Pepper</div>
        <Scroller data={this.state.data} />
      </div>
    )
  }
}

//         <Modal visible={this.props.location !== '/'}>
//         </Modal>
