Skip to content

Commit 88ca492

Browse files
committed
feat: add UsersTable and TooltipIconButton components with customizable properties
Signed-off-by: Amit Amrutiya <amitamrutiya2210@gmail.com>
1 parent 00225a9 commit 88ca492

5 files changed

Lines changed: 557 additions & 0 deletions

File tree

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import React from 'react';
2+
import { IconButton } from '../../base/IconButton';
3+
import { useTheme } from '../../theme';
4+
import { CustomTooltip } from '../CustomTooltip';
5+
import { IconWrapper } from '../ResponsiveDataTable';
6+
7+
interface TooltipIconProps {
8+
title: string;
9+
onClick?: (event: React.MouseEvent<HTMLElement>) => void;
10+
icon?: React.ReactNode;
11+
arrow?: boolean;
12+
style?: React.CSSProperties;
13+
iconType?: string;
14+
id?: string;
15+
placement?: 'bottom' | 'top' | 'left' | 'right';
16+
disabled?: boolean;
17+
children?: React.ReactNode;
18+
}
19+
20+
export function TooltipIcon({
21+
children,
22+
title,
23+
onClick,
24+
icon,
25+
style,
26+
arrow = true,
27+
disabled = false,
28+
iconType,
29+
id,
30+
placement
31+
}: TooltipIconProps): JSX.Element {
32+
const theme = useTheme();
33+
34+
return (
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+
}
48+
},
49+
...style
50+
}}
51+
disableRipple
52+
>
53+
{icon || children}
54+
</IconButton>
55+
</IconWrapper>
56+
</CustomTooltip>
57+
);
58+
}
59+
60+
export default TooltipIcon;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import TooltipIcon from './TooltipIconButton';
2+
3+
export { TooltipIcon };

src/custom/UserSearchField/UserSearchFieldInput.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,23 @@ const UserSearchField: React.FC<UserSearchFieldProps> = ({
6262
usersSearch,
6363
setUsersSearch
6464
}) => {
65+
console.log('amit usersearchfield', {
66+
usersData,
67+
setUsersData,
68+
label,
69+
setDisableSave,
70+
handleNotifyPref,
71+
notifyUpdate,
72+
isCreate,
73+
searchType,
74+
disabled,
75+
currentUserData,
76+
searchedUsers,
77+
isUserSearchLoading,
78+
fetchSearchedUsers,
79+
usersSearch,
80+
setUsersSearch
81+
});
6582
const [error, setError] = useState('');
6683
const [open, setOpen] = useState(false);
6784
const [showAllUsers, setShowAllUsers] = useState(false);

0 commit comments

Comments
 (0)