File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ import { IconButton } from '@mui/material' ;
2+ import React from 'react' ;
3+ import { CustomTooltip } from '../CustomTooltip' ;
4+ import { L5EditIcon } from './styles' ;
5+
6+ interface EditButtonProps {
7+ onClick : ( e : React . MouseEvent ) => void ;
8+ disabled ?: boolean ;
9+ title ?: string ;
10+ }
11+
12+ const EditButton : React . FC < EditButtonProps > = ( { onClick, disabled, title = 'Edit' } ) => {
13+ return (
14+ < CustomTooltip title = { title } >
15+ < div >
16+ < IconButton onClick = { onClick } disabled = { disabled } size = "small" sx = { { ml : 1 } } >
17+ < L5EditIcon />
18+ </ IconButton >
19+ </ div >
20+ </ CustomTooltip >
21+ ) ;
22+ } ;
23+
24+ export default EditButton ;
Original file line number Diff line number Diff line change 1- import { styled } from '../../theme' ;
1+ import EditIcon from '@mui/icons-material/Edit' ;
2+ import { buttonDisabled , styled } from '../../theme' ;
3+ import { HOVER_DELETE } from '../../theme/colors/colors' ;
24
35export const ModalActionDiv = styled ( 'div' ) ( {
46 display : 'flex' ,
57 gap : '1rem'
68} ) ;
9+
10+ interface ExtendedEditIconProps {
11+ disabled ?: boolean ;
12+ bulk ?: boolean ;
13+ style ?: React . CSSProperties ;
14+ }
15+
16+ export const L5EditIcon = styled ( EditIcon ) < ExtendedEditIconProps > (
17+ ( { disabled, bulk, style, theme } ) => ( {
18+ color : disabled ? theme . palette . icon . disabled : theme . palette . text . secondary ,
19+ cursor : disabled ? 'not-allowed' : 'pointer' ,
20+ width : bulk ? '32' : '28.8' ,
21+ height : bulk ? '32' : '28.8' ,
22+ '&:hover' : {
23+ color : disabled ? buttonDisabled : HOVER_DELETE ,
24+ '& svg' : {
25+ color : disabled ? buttonDisabled : HOVER_DELETE
26+ }
27+ } ,
28+ '& svg' : {
29+ color : theme . palette . error . main ,
30+ cursor : disabled ? 'not-allowed' : 'pointer'
31+ } ,
32+ ...style
33+ } )
34+ ) ;
You can’t perform that action at this time.
0 commit comments