bananas-commerce-admin
Version:
What's this, an admin for apes?
23 lines • 2.4 kB
JavaScript
import React from "react";
import CancelIcon from "@mui/icons-material/Cancel";
import CheckCircleIcon from "@mui/icons-material/CheckCircle";
import DeleteOutlineOutlinedIcon from "@mui/icons-material/DeleteOutlineOutlined";
import IconButton from "@mui/material/IconButton";
import InputAdornment from "@mui/material/InputAdornment";
import MenuItem from "@mui/material/MenuItem";
import Select from "@mui/material/Select";
import TableCell from "@mui/material/TableCell";
import TableRow from "@mui/material/TableRow";
import TextField from "@mui/material/TextField";
export const ArticlePriceRow = ({ price, isEditing, isDisabled, onChangeAmount, onChangePriceList, onDelete, priceLists, }) => (React.createElement(TableRow, { sx: { height: 56 } },
React.createElement(TableCell, { sx: { py: 0 } }, price.price_list.site_code),
React.createElement(TableCell, { sx: { py: 0 } }, isEditing && onChangePriceList && priceLists ? (React.createElement(Select, { fullWidth: true, required: true, disabled: isDisabled, size: "small", value: price.price_list.id, onChange: (event) => onChangePriceList(Number(event.target.value)) }, priceLists.map((priceList) => (React.createElement(MenuItem, { key: priceList.id, value: priceList.id }, priceList.name))))) : (price.price_list.name)),
React.createElement(TableCell, { align: "right", sx: { py: 0 } }, isEditing ? (React.createElement(TextField, { required: true, disabled: isDisabled, InputProps: {
endAdornment: (React.createElement(InputAdornment, { position: "end" }, price.price_list.currency)),
}, size: "small", sx: { ".MuiInputBase-input": { textAlign: "right" } }, value: price.amount, onChange: (event) => onChangeAmount?.(event.target.value) })) : (React.createElement(React.Fragment, null,
price.amount,
price.price_list.currency && ` ${price.price_list.currency}`))),
React.createElement(TableCell, { align: "right", sx: { py: 0 } }, price.price_list.is_active ? (React.createElement(CheckCircleIcon, { color: "success" })) : (React.createElement(CancelIcon, { color: "error" }))),
React.createElement(TableCell, { align: "right", sx: { py: 0, pl: 0, width: "56px" } }, isEditing && (React.createElement(IconButton, { disabled: isDisabled, onClick: () => onDelete?.() },
React.createElement(DeleteOutlineOutlinedIcon, null))))));
//# sourceMappingURL=ArticlePriceRow.js.map