Files
klz-cables.com/.pnpm-store/v10/files/27/d2bad70424d629f4cd460c44c6181e23b8c9344e575c07086a651a918894fe47ac2fa9f1d1358bc1573be907d5bb47a1dd4f8102954061a9581f6aef5beffd
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

35 lines
906 B
Plaintext

import { isPathMatchingRoute } from '../Root/isPathMatchingRoute.js';
export const getCustomViewByRoute = ({
baseRoute,
currentRoute,
views
}) => {
if (typeof views?.edit === 'object') {
let viewKey;
const foundViewConfig = Object.entries(views.edit).find(([key, view]) => {
if (typeof view === 'object' && 'path' in view) {
const viewPath = `${baseRoute}${view.path}`;
const isMatching = isPathMatchingRoute({
currentRoute,
exact: true,
path: viewPath
});
if (isMatching) {
viewKey = key;
}
return isMatching;
}
return false;
})?.[1];
if (foundViewConfig && 'Component' in foundViewConfig) {
return {
Component: foundViewConfig.Component,
viewKey
};
}
}
return {
Component: null
};
};
//# sourceMappingURL=getCustomViewByRoute.js.map