import { DefaultFooter, DefaultHeader } from '@@/app/_global/components/blocks'
import { THIRD_PARTY_APP_PRODUCT_VIEWER } from '@/config/url-prefix'

export default [
  {
    path: '/',
    component: () => import('@@/layouts/BaseLayout'),
    props: route => ({
      showHeader: route.query.showHeader === 'true',
      showFooter: route.query.showFooter === 'true',
    }),
    meta: {
      template: {
        header: DefaultHeader,
        footer: DefaultFooter,
        containerClass: 'product-viewer-screen',
      },
    },
    children: [
      {
        name: 'ProductViewerMain',
        path: THIRD_PARTY_APP_PRODUCT_VIEWER,
        component: {
          render(c) {
            return c('router-view')
          },
        },
        children: [
          {
            name: 'ProductViewerPage',
            path: ':type/:id',
            component: () => import('@@/app/product-viewer/components/blocks/ProductViewer'),
            props: true,
            meta: {
              template: {
                containerClass: 'product_viewer_page',
              },
            },
          },
        ],
      },
    ],
  },
]
