/*
 * Runtime Web – Unified Serverless Framework for Full-Stack TypeScript Applications
 * Documentation: https://runtimeweb.com/docs/getting-started
 *
 * @template: advanced
 */

import * as React from 'react';
import { Outlet } from 'react-router';
import { RuntimeHeadManager } from '@worktif/runtime';

import HomePage from './pages/HomePage';
import AboutPage from './pages/AboutPage';
import UsersPage from './pages/UsersPage';

/**
 * Runtime routes definition for React Router v7.
 *
 * The root route provides a shared layout that mounts the RuntimeHeadManager
 * above the Outlet so SEO metadata are managed centrally for all child routes.
 * Paths are constructed via Runtime's routePath helper to keep URLs consistent
 * across different deployment stages (dev, staging, prod).
 */
export const routes = [
  {
    path: '/',
    id: 'root',
    Component: () => (
      <>
        <RuntimeHeadManager/>
        <Outlet/>
      </>
    ),
    children: [
      {
        path: '/',
        id: 'home',
        Component: HomePage,
      },
      {
        path: '/about',
        id: 'about',
        Component: AboutPage,
      },
      {
        id: '3',
        path: '/users',
        element: <UsersPage/>
      },
    ],
  },
];
