0
0
Fork 0

Add notification policies and notification requests in web UI (#29433)

This commit is contained in:
Eugen Rochko 2024-03-11 16:02:21 +01:00 committed by GitHub
parent 19efa1b9f1
commit c10bbf5fe3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
35 changed files with 1278 additions and 252 deletions

View file

@ -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,
};