"use client";
'use strict';

var NProgress = require('nprogress');
var navigation = require('next/navigation');
var React = require('react');

// remove NProgress progress bar spinner circle
NProgress.configure({ showSpinner: false });
function NProgressBar() {
    const pathname = navigation.usePathname();
    const previousPath = React.useRef(pathname);
    React.useEffect(() => {
        if (previousPath.current !== pathname) {
            NProgress.start();
            setTimeout(() => {
                NProgress.done();
            }, 100);
            previousPath.current = pathname;
        }
    }, [pathname]);
    return null;
}

exports.NProgressBar = NProgressBar;
