import DefaultTheme from 'vitepress/theme'
import { h } from 'vue'
import InstallApp from './InstallApp.vue'
import './custom.css'

if (typeof window !== 'undefined') {
  import('virtual:pwa-register').then(({ registerSW }) => {
    registerSW({ immediate: true })
  })
}

export default {
  extends: DefaultTheme,
  Layout: () => {
    return h(DefaultTheme.Layout, null, {
      'layout-bottom': () => h(InstallApp),
    })
  },
}
