// src/components/BreadcrumbMenu/useUrlParams.ts
import { useMemo } from "react";
import { useLocation } from "react-router-dom";
var useUrlParams = (config) => {
  const location = useLocation();
  return useMemo(() => {
    const segments = location.pathname.split("/").filter(Boolean);
    const params = {};
    for (const [key, index] of Object.entries(config)) {
      params[key] = segments[index];
    }
    return params;
  }, [location.pathname, config]);
};
export {
  useUrlParams
};
//# sourceMappingURL=index.mjs.map