import { Component } from 'react';
import Box from '@mui/material/Box';
import Chip from '@mui/material/Chip';
import IconButton from '@mui/material/IconButton';
import LayersOutlinedIcon from '@mui/icons-material/LayersOutlined';
const taxPillSx = {
height: 28,
fontSize: 13,
fontWeight: 600,
'& .MuiChip-label': { px: 1 },
};
export class TaxRatePills extends Component {
render() {
const { rates, selected, onSelect, readOnly } = this.props;
return (
{rates.map((rate) => {
const active = Number(selected) === Number(rate);
return (
onSelect(rate)}
sx={{
...taxPillSx,
visibility: active || !readOnly ? 'visible' : 'hidden',
bgcolor: active ? 'rgba(0, 0, 0, 0.14)' : 'rgba(0, 0, 0, 0.06)',
...(readOnly
? {}
: {
cursor: 'pointer',
'&:hover': { bgcolor: 'rgba(0, 0, 0, 0.12)' },
}),
}}
/>
);
})}
);
}
}
export class PriceTaxRow extends Component {
render() {
const { rates, selected, onSelectTax, readOnly, onOpenTiers } = this.props;
return (
);
}
}