UNPKG

bananas-commerce-admin

Version:

What's this, an admin for apes?

19 lines 1.76 kB
import React from "react"; import DeleteOutlineOutlinedIcon from "@mui/icons-material/DeleteOutlineOutlined"; import { IconButton, InputAdornment, TableRow, TextField } from "@mui/material"; import { TableCell } from "../../../components/Table/TableCell"; import { useI18n } from "../../../contexts/I18nContext"; export const PriceRow = ({ price, isEditing, isDisabled, onChangeAmount, onChangeArticleCode, onDelete, }) => { const { t } = useI18n(); return (React.createElement(TableRow, { sx: { height: 56 } }, React.createElement(TableCell, { sx: { py: 0 } }, isEditing && onChangeArticleCode ? (React.createElement(TextField, { fullWidth: true, required: true, disabled: isDisabled, size: "small", value: price.article_code, onChange: (event) => onChangeArticleCode(event.target.value) })) : (price.article_code)), React.createElement(TableCell, { align: "right", sx: { py: 0 } }, isEditing ? (React.createElement(TextField, { required: true, disabled: isDisabled, InputProps: { endAdornment: React.createElement(InputAdornment, { position: "end" }, price.currency), placeholder: t("Article Number"), }, size: "small", sx: { ".MuiInputBase-input": { textAlign: "right" } }, value: price.amount, onChange: (event) => onChangeAmount?.(event.target.value) })) : (React.createElement(React.Fragment, null, price.amount, price.currency && ` ${price.currency}`))), 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=PriceRow.js.map