@rsc-labs/medusa-store-analytics
Version:
Get analytics data about your store
27 lines (26 loc) • 3.13 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VariantsTopTable = void 0;
const jsx_runtime_1 = require("react/jsx-runtime");
/*
* Copyright 2024 RSC-Labs, https://rsoftcon.com/
*
* MIT License
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
const ui_1 = require("@medusajs/ui");
const material_1 = require("@mui/material");
const react_router_dom_1 = require("react-router-dom");
const VariantsTopTable = ({ tableRows }) => {
return ((0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, spacing: 2, children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 12, children: (0, jsx_runtime_1.jsx)(material_1.Divider, {}) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 12, children: (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, justifyContent: 'space-between', children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, children: (0, jsx_runtime_1.jsx)(ui_1.Heading, { level: "h3", children: "Variant" }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, children: (0, jsx_runtime_1.jsx)(ui_1.Heading, { level: "h3", children: "Count" }) })] }) }), tableRows.length > 0 ? tableRows.map(tableRow => ((0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 12, children: (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, justifyContent: 'space-between', children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, children: (0, jsx_runtime_1.jsx)(react_router_dom_1.Link, { to: `../products/${tableRow.productId}`, children: (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, alignItems: 'center', spacing: 2, children: [tableRow.thumbnail && (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, children: (0, jsx_runtime_1.jsx)(material_1.Box, { sx: {
width: 30,
height: 40
}, component: "img", alt: `Thumbnail for ${tableRow.productTitle}`, src: tableRow.thumbnail }) }), (0, jsx_runtime_1.jsxs)(material_1.Grid, { item: true, children: [tableRow.productTitle, " - ", tableRow.variantTitle] })] }) }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, children: (0, jsx_runtime_1.jsx)(ui_1.Text, { children: tableRow.sum }) })] }) }, tableRow.productId))) :
(0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, xs: 12, children: (0, jsx_runtime_1.jsxs)(material_1.Grid, { container: true, justifyContent: 'space-between', children: [(0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, children: (0, jsx_runtime_1.jsx)(ui_1.Text, { children: "None" }) }), (0, jsx_runtime_1.jsx)(material_1.Grid, { item: true, children: (0, jsx_runtime_1.jsx)(ui_1.Text, { children: "None" }) })] }) })] }));
};
exports.VariantsTopTable = VariantsTopTable;