Add notification policies and notification requests in web UI (#29433)
This commit is contained in:
parent
19efa1b9f1
commit
c10bbf5fe3
35 changed files with 1278 additions and 252 deletions
|
@ -0,0 +1,31 @@
|
|||
import PropTypes from 'prop-types';
|
||||
import { useCallback } from 'react';
|
||||
|
||||
import Toggle from 'react-toggle';
|
||||
|
||||
export const CheckboxWithLabel = ({ checked, disabled, children, onChange }) => {
|
||||
const handleChange = useCallback(({ target }) => {
|
||||
onChange(target.checked);
|
||||
}, [onChange]);
|
||||
|
||||
return (
|
||||
<label className='app-form__toggle'>
|
||||
<div className='app-form__toggle__label'>
|
||||
{children}
|
||||
</div>
|
||||
|
||||
<div className='app-form__toggle__toggle'>
|
||||
<div>
|
||||
<Toggle checked={checked} onChange={handleChange} disabled={disabled} />
|
||||
</div>
|
||||
</div>
|
||||
</label>
|
||||
);
|
||||
};
|
||||
|
||||
CheckboxWithLabel.propTypes = {
|
||||
checked: PropTypes.bool,
|
||||
disabled: PropTypes.bool,
|
||||
children: PropTypes.children,
|
||||
onChange: PropTypes.func,
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue