import { lazy } from 'react';
import i18next from 'i18next';

import RentAndBuy from './RentAndBuy';
import en from './i18n/en';

i18next.addResourceBundle('en', 'rentAndBuyPage', en);

const SearchAddress = lazy(() => import('./components/SearchAddress/SearchAddress'));
const PropertyPreview = lazy(() => import('./components/PropertyPreview/PropertyPreview'));

const RentAndBuyConfig = {
  settings: {
    layout: {
      config: {},
      style: 'layout2',
    },
  },
  auth: null,
  routes: [
    {
      path: '/rent-and-buy',
      element: <RentAndBuy />,
      children: [
        {
          path: 'search',
          element: <SearchAddress />,
        },
        {
          path: 'preview',
          element: <PropertyPreview />,
        },
      ],
    },
  ],
};

export default RentAndBuyConfig;
