-
-
Notifications
You must be signed in to change notification settings - Fork 864
/
Copy pathIconComponent.tsx
165 lines (162 loc) · 4.88 KB
/
IconComponent.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
import {
QuestionMarkOutlined,
ContactPageOutlined,
NewspaperOutlined,
} from '@mui/icons-material';
import ActionItemIcon from 'assets/svgs/actionItem.svg?react';
import BlockUserIcon from 'assets/svgs/blockUser.svg?react';
import CheckInRegistrantsIcon from 'assets/svgs/checkInRegistrants.svg?react';
import DashboardIcon from 'assets/svgs/dashboard.svg?react';
import EventsIcon from 'assets/svgs/events.svg?react';
import FundsIcon from 'assets/svgs/funds.svg?react';
import ListEventRegistrantsIcon from 'assets/svgs/listEventRegistrants.svg?react';
import OrganizationsIcon from 'assets/svgs/organizations.svg?react';
import PeopleIcon from 'assets/svgs/people.svg?react';
import TagsIcon from 'assets/svgs/tags.svg?react';
import TagIcon from 'assets/svgs/tag.svg?react';
import PluginsIcon from 'assets/svgs/plugins.svg?react';
import PostsIcon from 'assets/svgs/posts.svg?react';
import SettingsIcon from 'assets/svgs/settings.svg?react';
import VenueIcon from 'assets/svgs/venues.svg?react';
import RequestsIcon from 'assets/svgs/requests.svg?react';
import ExitToAppIcon from '@mui/icons-material/ExitToApp';
import { MdOutlineVolunteerActivism } from 'react-icons/md';
import React from 'react';
export interface InterfaceIconComponent {
name: string;
fill?: string;
height?: string;
width?: string;
}
/**
* Renders an icon based on the provided name.
*
* @param props - Contains the name of the icon and optional styles (fill, height, width).
* @returns JSX element representing the icon.
*/
const iconComponent = (props: InterfaceIconComponent): JSX.Element => {
switch (props.name) {
case 'My Organizations':
return (
<OrganizationsIcon
stroke={props.fill}
data-testid="Icon-Component-MyOrganizationsIcon"
/>
);
case 'Dashboard':
return (
<DashboardIcon {...props} data-testid="Icon-Component-DashboardIcon" />
);
case 'People':
return <PeopleIcon {...props} data-testid="Icon-Component-PeopleIcon" />;
case 'Tags':
return <TagsIcon {...props} data-testid="Icon-Component-TagsIcon" />;
case 'Tag':
return <TagIcon {...props} data-testid="Icon-Component-TagIcon" />;
case 'Requests':
return (
<RequestsIcon {...props} data-testid="Icon-Component-RequestsIcon" />
);
case 'Events':
return <EventsIcon {...props} data-testid="Icon-Component-EventsIcon" />;
case 'Action Items':
return (
<ActionItemIcon
{...props}
data-testid="Icon-Component-ActionItemIcon"
/>
);
case 'Posts':
return <PostsIcon {...props} data-testid="Icon-Component-PostsIcon" />;
case 'Block/Unblock':
return (
<BlockUserIcon
{...props}
data-testid="Block/Icon-Component-UnblockIcon"
/>
);
case 'Plugins':
return (
<PluginsIcon
stroke={props.fill}
data-testid="Icon-Component-PluginsIcon"
/>
);
case 'Settings':
return (
<SettingsIcon
stroke={props.fill}
data-testid="Icon-Component-SettingsIcon"
/>
);
case 'List Event Registrants':
return (
<ListEventRegistrantsIcon
data-testid="Icon-Component-List-Event-Registrants"
stroke={props.fill}
/>
);
case 'Check In Registrants':
return (
<CheckInRegistrantsIcon
data-testid="Icon-Component-Check-In-Registrants"
stroke={props.fill}
/>
);
case 'Advertisement':
return (
<PostsIcon
data-testid="Icon-Component-Advertisement"
stroke={props.fill}
/>
);
case 'Funds':
return (
<FundsIcon data-testid="Icon-Component-Funds" stroke={props.fill} />
);
case 'Venues':
return (
<VenueIcon data-testid="Icon-Component-Venues" stroke={props.fill} />
);
case 'Donate':
return (
<FundsIcon data-testid="Icon-Component-Donate" stroke={props.fill} />
);
case 'Campaigns':
return (
<NewspaperOutlined {...props} data-testid="Icon-Component-Campaigns" />
);
case 'My Pledges':
return (
<ContactPageOutlined
data-testid="Icon-Component-My-Pledges"
stroke={props.fill}
/>
);
case 'Leave Organization':
return (
<ExitToAppIcon
data-testid="Icon-Component-Leave-Organization"
stroke={props.fill}
/>
);
case 'Volunteer':
return (
<MdOutlineVolunteerActivism
fill={props.fill}
height={props.height}
width={props.width}
data-testid="Icon-Component-Volunteer"
/>
);
default:
return (
<QuestionMarkOutlined
{...props}
fontSize="large"
data-testid="Icon-Component-DefaultIcon"
/>
);
}
};
export default iconComponent;