@@ -4,16 +4,6 @@ import React from 'react';
44import PropTypes from 'prop-types' ;
55import CheckIcon from '@mui/icons-material/Check' ;
66import { FormControl , Select , Divider , MenuItem , ListItemText , ListItemIcon } from '@mui/material' ;
7- import makeStyles from '@mui/styles/makeStyles' ;
8-
9- const useStyles = makeStyles ( ( theme ) => ( {
10- selectWithAction : {
11- width : '100%' ,
12- } ,
13- listItemIcon : {
14- minWidth : '44px' ,
15- } ,
16- } ) ) ;
177
188export const SelectWithAction = ( {
199 options,
@@ -22,10 +12,8 @@ export const SelectWithAction = ({
2212 isReadOnly = false ,
2313 actions = [ ] ,
2414} ) => {
25- const classes = useStyles ( ) ;
26-
2715 return (
28- < div className = { classes . selectWithAction } >
16+ < div style = { { width : '100%' } } >
2917 < FormControl variant = "outlined" fullWidth = { true } >
3018 < Select
3119 data-cy = "select-with-action"
@@ -51,8 +39,7 @@ export const SelectWithAction = ({
5139 < MenuItem key = { option . value } value = { option . value } >
5240 < ListItemIcon
5341 data-cy = { `select-${ option . value } -checked-icon` }
54- className = { classes . listItemIcon }
55- style = { selectedOption === option . value ? { visibility : 'visible' } : { visibility : 'hidden' } }
42+ style = { { minWidth : '44px' , visibility : selectedOption === option . value ? 'visible' : 'hidden' } }
5643 >
5744 < CheckIcon color = "secondary" />
5845 </ ListItemIcon >
@@ -66,9 +53,7 @@ export const SelectWithAction = ({
6653 < ul >
6754 { actions . map ( ( action ) => (
6855 < MenuItem key = { action . id } className = { action . classes } value = { action . id } onClick = { action . onClick } >
69- < ListItemIcon className = { classes . listItemIcon } style = { { color : 'inherit' } } >
70- { action . icon }
71- </ ListItemIcon >
56+ < ListItemIcon style = { { color : 'inherit' , minWidth : '44px' } } > { action . icon } </ ListItemIcon >
7257 < ListItemText data-cy = "select-action-name" primary = { action . label } />
7358 </ MenuItem >
7459 ) ) }
0 commit comments