Files
klz-cables.com/.pnpm-store/v10/files/af/4faf7964d46411e4268a0bb0d7b6fcb3c09a0f7b29bf70d84fb574635e6c218a1c36c8de4a15457194a8108e827ac071f5f56b0d4f3661e3cd354dc49fda36
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

78 lines
2.3 KiB
Plaintext

import { jsx as _jsx } from "react/jsx-runtime";
import { RenderServerComponent } from '@payloadcms/ui/elements/RenderServerComponent';
import React from 'react';
import { ShouldRenderTabs } from './ShouldRenderTabs.js';
import { DefaultDocumentTab } from './Tab/index.js';
import { getTabs } from './tabs/index.js';
const baseClass = 'doc-tabs';
export const DocumentTabs = ({
collectionConfig,
globalConfig,
permissions,
req
}) => {
const {
config
} = req.payload;
const tabs = getTabs({
collectionConfig,
globalConfig
});
return /*#__PURE__*/_jsx(ShouldRenderTabs, {
children: /*#__PURE__*/_jsx("div", {
className: baseClass,
children: /*#__PURE__*/_jsx("div", {
className: `${baseClass}__tabs-container`,
children: /*#__PURE__*/_jsx("ul", {
className: `${baseClass}__tabs`,
children: tabs?.map(({
tab: tabConfig,
viewPath
}, index) => {
const {
condition
} = tabConfig || {};
const meetsCondition = !condition || condition({
collectionConfig,
config,
globalConfig,
permissions,
req
});
if (!meetsCondition) {
return null;
}
if (tabConfig?.Component) {
return RenderServerComponent({
clientProps: {
path: viewPath
},
Component: tabConfig.Component,
importMap: req.payload.importMap,
key: `tab-${index}`,
serverProps: {
collectionConfig,
globalConfig,
i18n: req.i18n,
payload: req.payload,
permissions,
req,
user: req.user
}
});
}
return /*#__PURE__*/_jsx(DefaultDocumentTab, {
collectionConfig: collectionConfig,
globalConfig: globalConfig,
path: viewPath,
permissions: permissions,
req: req,
tabConfig: tabConfig
}, `tab-${index}`);
})
})
})
})
});
};
//# sourceMappingURL=index.js.map