add api config

This commit is contained in:
Henry
2023-05-04 18:44:51 +01:00
parent 57b8620b93
commit 8d3a374257
18 changed files with 589 additions and 59 deletions
@@ -0,0 +1,34 @@
import { useState } from 'react'
import PropTypes from 'prop-types'
import { FormControlLabel, Checkbox } from '@mui/material'
export const CheckboxInput = ({ value, label, onChange, disabled = false }) => {
const [myValue, setMyValue] = useState(value)
return (
<>
<FormControlLabel
sx={{ mt: 1, width: '100%' }}
size='small'
control={
<Checkbox
disabled={disabled}
checked={myValue}
onChange={(event) => {
setMyValue(event.target.checked)
onChange(event.target.checked)
}}
/>
}
label={label}
/>
</>
)
}
CheckboxInput.propTypes = {
value: PropTypes.bool,
label: PropTypes.string,
onChange: PropTypes.func,
disabled: PropTypes.bool
}