import { Grid, Typography, FormControlLabel, Checkbox } from '@mui/material';
import DESCRIPTIONS from '../constants/descriptions';

const RAD = ({ state = {}, handleChange = (name = '', val = '') => {} }) => {
	return (
		<Grid container spacing={1} flex mt={3} mb={3}>
			<Grid item flex={1} xs={4}>
				<Typography variant='subtitle1' fontWeight='bold'>
					Residential delivery
				</Typography>
				<p>
					<strong>Always quote residential delivery</strong> -{' '}
					{DESCRIPTIONS.quote_residential}
				</p>
			</Grid>

			<Grid item flex={2} xs={8}>
				<FormControlLabel
					control={
						<Checkbox
							checked={state?.always_quote_residential_delivery || false}
							onChange={e =>
								handleChange('always_quote_residential_delivery', e.target.checked)
							}
						/>
					}
					label='Always quote residential delivery'
					title='Always quote residential delivery'
				/>
			</Grid>
		</Grid>
	);
};

export default RAD;
