import React, { lazy } from 'react'
import Loadable from 'app/components/Loadable/Loadable'
import { authRoles } from '../../auth/authRoles'

const Analytics = Loadable(lazy(() => import('./Analytics')))

//Companies
const Companies = Loadable(lazy(() => import('../istar/companies/Companies')))
const AddCompany = Loadable(
    lazy(() => import('../istar/companies/AddCompany/AddCompany'))
)
const EditCompany = Loadable(
    lazy(() => import('../istar/companies/EditCompany/EditCompany'))
)

//Company Users
const CompanyUsers = Loadable(
    lazy(() => import('../istar/companyUsers/CompanyUsers'))
)
const AddCompanyUser = Loadable(
    lazy(() => import('../istar/companyUsers/AddCompanyUser/AddCompanyUser'))
)
const EditCompanyUser = Loadable(
    lazy(() => import('../istar/companyUsers/EditCompanyUser/EditCompanyUser'))
)
const ChangePassword = Loadable(
    lazy(() => import('../istar/companyUsers/EditCompanyUser/ChangePassword'))
)

//Questions
const Questions = Loadable(lazy(() => import('../istar/questions/Questions')))
const AddQuestion = Loadable(
    lazy(() => import('../istar/questions/AddQuestion/AddQuestion'))
)
const EditQuestion = Loadable(
    lazy(() => import('../istar/questions/EditQuestion/EditQuestion'))
)

//Questions
const UserGuests = Loadable(
    lazy(() => import('../istar/userGuests/UserGuests'))
)
const GuestResponse = Loadable(
    lazy(() => import('../istar/userGuests/GuestResponse'))
)

const TestPDF = Loadable(lazy(() => import('../istar/TestPDF')))

const dashboardRoutes = [
    {
        path: '/admin/testPDF',
        element: <TestPDF />,
        auth: authRoles.admin,
    },
    {
        path: '/dashboard/default',
        element: <Analytics />,
        auth: authRoles.admin,
    },
    {
        path: '/admin/companies/all',
        element: <Companies />,
        auth: authRoles.admin,
    },
    {
        path: '/admin/company/add',
        element: <AddCompany />,
        auth: authRoles.admin,
    },
    {
        path: '/admin/company/edit/:id',
        element: <EditCompany />,
        auth: authRoles.admin,
    },
    {
        path: '/admin/company-users/all',
        element: <CompanyUsers />,
        auth: authRoles.admin,
    },
    {
        path: '/admin/company-users/add',
        element: <AddCompanyUser />,
        auth: authRoles.admin,
    },
    {
        path: '/admin/company-users/edit/:id',
        element: <EditCompanyUser />,
        auth: authRoles.admin,
    },
    {
        path: '/admin/company-users/change-password/:id',
        element: <ChangePassword />,
        auth: authRoles.admin,
    },
    {
        path: '/admin/questions/all',
        element: <Questions />,
        auth: authRoles.admin,
    },
    {
        path: '/admin/questions/add',
        element: <AddQuestion />,
        auth: authRoles.admin,
    },
    {
        path: '/admin/questions/edit/:id',
        element: <EditQuestion />,
        auth: authRoles.admin,
    },
    {
        path: '/admin/user-guests/all',
        element: <UserGuests />,
        auth: authRoles.admin,
    },
    {
        path: '/admin/customer-responses/:id',
        element: <GuestResponse />,
        auth: authRoles.admin,
    },
]

export default dashboardRoutes
