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 { SxProps } from '@mui/material/styles ' ;
1+ import { IconButton } from '@mui/material' ;
22import React from 'react' ;
3- import { IconButton } from '../base/IconButton ' ;
3+ import { useTheme } from '../theme ' ;
44import { CustomTooltip } from './CustomTooltip' ;
5+ import { IconWrapper } from './ResponsiveDataTable' ;
56
67interface TooltipIconProps {
78 title : string ;
89 onClick ?: ( event : React . MouseEvent < HTMLElement > ) => void ;
9- icon : React . ReactNode ;
10+ icon ? : React . ReactNode ;
1011 arrow ?: boolean ;
1112 style ?: React . CSSProperties ;
13+ iconType ?: string ;
14+ id ?: string ;
15+ placement ?: 'bottom' | 'top' | 'left' | 'right' ;
16+ disabled ?: boolean ;
17+ children ?: React . ReactNode ;
1218}
1319
1420export function TooltipIcon ( {
21+ children,
1522 title,
1623 onClick,
1724 icon,
1825 style,
19- arrow = false
26+ arrow = false ,
27+ disabled = false ,
28+ iconType,
29+ id,
30+ placement
2031} : TooltipIconProps ) : JSX . Element {
32+ const theme = useTheme ( ) ;
33+
2134 return (
22- < CustomTooltip title = { title } arrow = { arrow } >
23- < IconButton
24- onClick = { onClick }
25- sx = { {
26- '&:hover' : {
27- '& svg' : {
28- fill : '#00d3a9'
35+ < CustomTooltip title = { title } arrow = { arrow } placement = { placement } id = { id } >
36+ < IconWrapper disabled = { disabled } >
37+ < IconButton
38+ disabled = { disabled }
39+ onClick = { onClick }
40+ sx = { {
41+ '&:hover' : {
42+ '& svg' : {
43+ fill :
44+ iconType === 'delete'
45+ ? theme . palette . error . main
46+ : theme . palette . primary . brand ?. default
47+ }
2948 } ,
30- borderRadius : '4px'
31- } ,
32- ...( style as SxProps )
33- } }
34- disableRipple
35- >
36- { icon }
37- </ IconButton >
49+ ...style
50+ } }
51+ disableRipple
52+ >
53+ { icon || children }
54+ </ IconButton >
55+ </ IconWrapper >
3856 </ CustomTooltip >
3957 ) ;
4058}
You can’t perform that action at this time.
0 commit comments