import { router } from "@repo/core-shared/trpc/init";

import { navigationContainer } from "../../di/container";
import { NAVIGATION_SYMBOLS } from "../../di/symbols";

import { getHeaderInputSchema } from "../../application/use-cases/get-header.use-case";
import type { IGetHeaderController } from "../../interface-adapters/controllers/get-header.controller";

import { navigationProcedure } from "./procedures";

export const navigationRouter = router({
  header: navigationProcedure
    .input(getHeaderInputSchema)
    .query(({ input }) => {
      const ctrl = navigationContainer.get<IGetHeaderController>(
        NAVIGATION_SYMBOLS.IGetHeaderController,
      );
      return ctrl(input);
    }),
});

export type NavigationRouter = typeof navigationRouter;
