"use client";

import { useRouter } from "next/navigation";
import { startRouteProgress } from "@/utils/routeProgress";
import { useTranslation } from "./useTranslation";

export function useRouterNavigation() {
    const router = useRouter();
    const { language } = useTranslation();

    const navigate = (route: string) => {
        const normalizedRoute = route.startsWith("/")
            ? route
            : `/${route}`;

        startRouteProgress();
        router.push(`/${language}${normalizedRoute}`);
    };

    return { navigate };
}
