import {Route, Routes, Outlet, Navigate } from 'react-router-dom'
import {PageLink, PageTitle} from '../../../../_digifi/layout/core'
import {UsersListWrapper} from './users-list/UsersList'
import { CustomersListWrapper } from './customers-list/UsersList'

const usersBreadcrumbs: Array<PageLink> = [
  {
    title: 'User Management',
    path: '/tools/user-management/users',
    isSeparator: false,
    isActive: false,
  },
  {
    title: '',
    path: '',
    isSeparator: true,
    isActive: false,
  },
]

const UsersPage = () => {

  return (
    <Routes>
      <Route element={<Outlet />}>
        <Route
          path='users'
          element={
            <>
              <PageTitle breadcrumbs={usersBreadcrumbs}>Users list</PageTitle>
              <UsersListWrapper />
            </>
          }
        />
        <Route
          path='customers'
          element={
            <>
              <PageTitle breadcrumbs={usersBreadcrumbs}>Customers list</PageTitle>
              <CustomersListWrapper />
            </>
          }
        />
      </Route>
      <Route index element={<Navigate to='/tools/user-management/users' />} />
    </Routes>
  )
}

export default UsersPage
