import type { ReduxStateType } from "@store/types";
import { useSelector } from "react-redux";

export const useActiveRoute = () => {
	const { isLoading, isRefetching } = useSelector(
		(state: ReduxStateType) => state.routes,
	);
	const activeRoute = useSelector(
		(state: ReduxStateType) => state.routes.activeRoute,
	);

	return { data: activeRoute, isLoading, isRefetching };
};
