import React from 'react'; import PropTypes from 'prop-types'; import './PowerLevelSelector.scss'; import IconButton from '../../atoms/button/IconButton'; import { MenuHeader, MenuItem } from '../../atoms/context-menu/ContextMenu'; import CheckIC from '../../../../public/res/ic/outlined/check.svg'; function PowerLevelSelector({ value, max, onSelect, }) { const handleSubmit = (e) => { const powerLevel = e.target.elements['power-level']?.value; if (!powerLevel) return; onSelect(Number(powerLevel)); }; return (
Power level selector
{ e.preventDefault(); handleSubmit(e); }}> {max >= 0 && Presets} {max >= 100 && onSelect(100)}>Admin - 100} {max >= 50 && onSelect(50)}>Mod - 50} {max >= 0 && onSelect(0)}>Member - 0}
); } PowerLevelSelector.propTypes = { value: PropTypes.number.isRequired, max: PropTypes.number.isRequired, onSelect: PropTypes.func.isRequired, }; export default PowerLevelSelector;