import Router from 'ampersand-router'
import React from 'react'
import HomePage from './pages/home'
import ContactPage from './pages/contact'
import Layout from './layout'

export default Router.extend({
  renderPage (page, opts = {layout: true}) {
    if (opts.layout) {
      page = (
        <Layout>
          {page}
        </Layout>
      )
    }
    React.render(page, document.body)
  },

  routes: {
    '': 'home',
    'contact': 'contact'
  },

  home () {
    this.renderPage(<HomePage/>)
  },

  contact () {
    this.renderPage(<ContactPage/>)
  }
})

@@ -131,24 +131,69 @@
 es/contact'%0A
+import NotFoundPage from './pages/not-found'%0A
 import Layou
@@ -487,16 +487,45 @@
 contact'
+,%0A    '*notFound': 'notFound'
 %0A  %7D,%0A%0A 
@@ -625,15 +625,74 @@
 Page/%3E)%0A
+  %7D,%0A%0A  notFound () %7B%0A    this.renderPage(%3CNotFoundPage/%3E)%0A
   %7D%0A%7D)%0A

add not-found page to router