Files
klz-cables.com/.pnpm-store/v10/files/18/8f319d13c8ab11f298bd351ff134dfb0757dd76862970e4946b5bbe4bfd4ce76a495effc2ba01fa690aebe6e8281ff44702dfa03b6ff23988f21220e726e5c
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

52 lines
1.7 KiB
Plaintext

'use client';
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
import { getBestFitFromSizes, isImage } from 'payload/shared';
import React from 'react';
import './index.scss';
import { Thumbnail } from '../../../../Thumbnail/index.js';
const baseClass = 'file';
export const FileCell = ({
cellData: filename,
collectionConfig,
field,
rowData
}) => {
const fieldPreviewAllowed = 'displayPreview' in field ? field.displayPreview : undefined;
const previewAllowed = fieldPreviewAllowed ?? collectionConfig.upload?.displayPreview ?? true;
if (previewAllowed) {
const isFileImage = isImage(rowData?.mimeType);
let fileSrc = isFileImage ? rowData?.thumbnailURL || rowData?.url : rowData?.thumbnailURL;
if (isFileImage) {
fileSrc = getBestFitFromSizes({
sizes: rowData?.sizes,
thumbnailURL: rowData?.thumbnailURL,
url: rowData?.url,
width: rowData?.width
});
}
return /*#__PURE__*/_jsxs("div", {
className: baseClass,
children: [/*#__PURE__*/_jsx(Thumbnail, {
className: `${baseClass}__thumbnail`,
collectionSlug: collectionConfig?.slug,
doc: {
...rowData,
filename
},
fileSrc: fileSrc,
imageCacheTag: collectionConfig?.upload?.cacheTags && rowData?.updatedAt,
size: "small",
uploadConfig: collectionConfig?.upload
}), /*#__PURE__*/_jsx("span", {
className: `${baseClass}__filename`,
children: String(filename)
})]
});
} else {
return /*#__PURE__*/_jsx(_Fragment, {
children: String(filename)
});
}
};
//# sourceMappingURL=index.js.map