Files
klz-cables.com/.pnpm-store/v10/files/6a/846c03d9e9da679b59106029258d244e8f037c97c6e96ce2c56b10956b49a75a45eaec8c8f477fe3fcc07e202e5d1c96241eaa8e7775498e4a753ce8a6b1e7
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

51 lines
1.7 KiB
Plaintext

'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React from 'react';
import './index.scss';
const baseClass = 'table';
export const Table = ({
appearance,
BeforeTable,
columns,
data
}) => {
const activeColumns = columns?.filter(col => col?.active);
if (!activeColumns || activeColumns.length === 0) {
return /*#__PURE__*/_jsx("div", {
children: "No columns selected"
});
}
return /*#__PURE__*/_jsxs("div", {
className: [baseClass, appearance && `${baseClass}--appearance-${appearance}`].filter(Boolean).join(' '),
children: [BeforeTable, /*#__PURE__*/_jsxs("table", {
cellPadding: "0",
cellSpacing: "0",
children: [/*#__PURE__*/_jsx("thead", {
children: /*#__PURE__*/_jsx("tr", {
children: activeColumns.map((col, i) => /*#__PURE__*/_jsx("th", {
id: `heading-${col.accessor.replace(/\./g, '__')}`,
children: col.Heading
}, i))
})
}), /*#__PURE__*/_jsx("tbody", {
children: data && data?.map((row, rowIndex) => {
return /*#__PURE__*/_jsx("tr", {
className: `row-${rowIndex + 1}`,
"data-id": row.id,
children: activeColumns.map((col, colIndex) => {
const {
accessor
} = col;
return /*#__PURE__*/_jsx("td", {
className: `cell-${accessor.replace(/\./g, '__')}`,
children: col.renderedCells[rowIndex]
}, colIndex);
})
}, typeof row.id === 'string' || typeof row.id === 'number' ? String(row.id) : rowIndex);
})
})]
})]
});
};
//# sourceMappingURL=index.js.map