import withReactRouterV3Compatibility from './hoc/withReactRouterV3Compatibility';
import SomethingWentWrong from '@capillarytech/cap-ui-library/CapSomethingWentWrong';
import NotFoundPage from './v2Containers/NotFoundPage';
import TemplatesV2 from './v2Containers/TemplatesV2';

// Package-specific routes that only include V2 components
// This is used when building the npm package where containers are excluded
const routes = [
  // V2 Routes (always available in package)
  {
    exact: true,
    path: '/v2/somethingwentwrong',
    name: 'somethingwentwrong',
    component: withReactRouterV3Compatibility(SomethingWentWrong),
  },
  {
    exact: true,
    path: '/v2',
    name: 'templatesV2',
    component: withReactRouterV3Compatibility(TemplatesV2),
  },
  {
    exact: true,
    path: '/v2/loyalty',
    name: 'loyalty',
    component: withReactRouterV3Compatibility(TemplatesV2),
  },
  
  // Catch-all fallback
  {
    path: '*',
    name: 'notfound',
    component: withReactRouterV3Compatibility(NotFoundPage),
  },
];

export default routes;
