irongit
531 lines17 KBJavaScript
1
2import { Icon } from "@chakra-ui/react";
3import { HiUsers } from "react-icons/hi";
4import {
5 MdContacts,
6 MdHome,
7 MdInsertChartOutlined,
8 MdLeaderboard,
9 MdLock
10} from "react-icons/md";
11// icon
12import React from "react";
13import { AiFillFolderOpen, AiOutlineMail } from "react-icons/ai";
14import { FaCalendarAlt, FaRupeeSign, FaTasks, FaWpforms } from "react-icons/fa";
15import { LuBuilding2 } from "react-icons/lu";
16import { PiPhoneCallBold } from "react-icons/pi";
17import { FaCreativeCommonsBy } from "react-icons/fa";
18import { SiGooglemeet } from "react-icons/si";
19import { ROLE_PATH } from "./roles";
20import ChangeImage from "views/admin/image";
21import Validation from "views/admin/validation";
22import CustomField from "views/admin/customField";
23import TableField from "views/admin/tableField";
24import activeDeactiveModule from "views/admin/activeDeactiveModule";
25import { TbExchange, TbTableColumn } from "react-icons/tb";
26import { GrValidate } from "react-icons/gr";
27import { VscFileSubmodule } from "react-icons/vsc";
28import { HiTemplate } from "react-icons/hi";
29import { TbBulb } from "react-icons/tb";
30import { BsBlockquoteRight } from "react-icons/bs";
31import { RiAccountCircleFill } from "react-icons/ri";
32import { TbInvoice } from "react-icons/tb";
33import { TbFileInvoice } from "react-icons/tb";
34// Admin Imports
35const MainDashboard = React.lazy(() => import("views/admin/default"));
36
37// My component
38const Contact = React.lazy(() => import('views/admin/contact'));
39const ContactView = React.lazy(() => import('views/admin/contact/View'));
40const ContactImport = React.lazy(() => import("views/admin/contact/components/ContactImport"));
41
42const Quotes = React.lazy(() => import('views/admin/quotes'));
43const QuotesView = React.lazy(() => import('views/admin/quotes/View'));
44const QuotesImport = React.lazy(() => import("views/admin/quotes/components/QuotesImport"));
45
46const Invoices = React.lazy(() => import('views/admin/invoice'));
47const InvoicesView = React.lazy(() => import('views/admin/invoice/View'));
48const InvoicesImport = React.lazy(() => import("views/admin/invoice/components/InvoiceImport"));
49
50const User = React.lazy(() => import("views/admin/users"));
51const UserView = React.lazy(() => import("views/admin/users/View"));
52
53const Property = React.lazy(() => import("views/admin/property"));
54const PropertyView = React.lazy(() => import("views/admin/property/View"));
55const PropertyImport = React.lazy(() => import("views/admin/property/components/PropertyImport"))
56
57const Lead = React.lazy(() => import("views/admin/lead"));
58const LeadView = React.lazy(() => import("views/admin/lead/View"));
59const LeadImport = React.lazy(() => import("views/admin/lead/components/LeadImport"));
60
61const Communication = React.lazy(() => import("views/admin/communication"));
62
63const Task = React.lazy(() => import("views/admin/task"));
64const TaskView = React.lazy(() => import("views/admin/task/components/taskView"));
65const Calender = React.lazy(() => import("views/admin/calender"));
66const Payments = React.lazy(() => import("views/admin/payments"));
67const Role = React.lazy(() => import("views/admin/role"));
68
69const Document = React.lazy(() => import("views/admin/document"));
70
71const EmailHistory = React.lazy(() => import("views/admin/emailHistory"));
72const EmailHistoryView = React.lazy(() => import("views/admin/emailHistory/View"));
73
74const Meeting = React.lazy(() => import("views/admin/meeting"));
75const MettingView = React.lazy(() => import("views/admin/meeting/View"));
76
77const PhoneCall = React.lazy(() => import("views/admin/phoneCall"));
78const PhoneCallView = React.lazy(() => import("views/admin/phoneCall/View"));
79
80const Report = React.lazy(() => import("views/admin/reports"));
81const EmailTemplate = React.lazy(() => import("views/admin/emailTemplate"));
82const AddEdit = React.lazy(() => import("views/admin/emailTemplate/AddEdit"));
83const templateView = React.lazy(() => import("views/admin/emailTemplate/view.js"));
84
85// Auth Imports
86const SignInCentered = React.lazy(() => import("views/auth/signIn"));
87// admin setting
88const AdminSetting = React.lazy(() => import("views/admin/adminSetting"));
89const validation = React.lazy(() => import("views/admin/validation"));
90const module = React.lazy(() => import("views/admin/moduleName"));
91const Opportunities = React.lazy(() => import("views/admin/opportunities"));
92const OpportunitiesView = React.lazy(() => import("views/admin/opportunities/View"));
93const OpportunitiesImport = React.lazy(() => import("views/admin/opportunities/components/OpprtunityImport"));
94const Account = React.lazy(() => import("views/admin/account"));
95const AccountView = React.lazy(() => import("views/admin/account/View"));
96const AccountImport = React.lazy(() => import("views/admin/account/components/AccountImport"));
97
98const routes = [
99 // ========================== Dashboard ==========================
100 {
101 name: "Dashboard",
102 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
103 path: "/default",
104 icon: <Icon as={MdHome} width='20px' height='20px' color='inherit' />,
105 component: MainDashboard,
106 },
107 // ========================== Admin Layout ==========================
108 // ------------- lead Routes ------------------------
109 {
110 name: "Leads",
111 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
112 path: "/lead",
113 icon: <Icon as={MdLeaderboard} width='20px' height='20px' color='inherit' />,
114 component: Lead,
115 },
116 {
117 name: "Leads",
118 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
119 under: "lead",
120 parentName: "Leads",
121 path: "/leadView/:id",
122 component: LeadView,
123 },
124 {
125 name: "Lead Import",
126 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
127 under: "lead",
128 parentName: "Leads",
129 path: "/leadImport",
130 component: LeadImport,
131 },
132 // --------------- contact Routes --------------------
133 {
134 name: "Contacts",
135 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
136 path: "/contacts",
137 icon: <Icon as={MdContacts} width='20px' height='20px' color='inherit' />,
138 component: Contact,
139 },
140 {
141 name: "Contacts",
142 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
143 under: "contacts",
144 parentName: "Contacts",
145 path: "/contactView/:id",
146 component: ContactView,
147 },
148 {
149 name: "Contact Import",
150 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
151 both: true,
152 under: "contacts",
153 parentName: "Contacts",
154 path: "/contactImport",
155 component: ContactImport,
156 },
157 // ------------- Property Routes ------------------------
158 {
159 name: "Properties",
160 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
161 path: "/properties",
162 icon: <Icon as={LuBuilding2} width='20px' height='20px' color='inherit' />,
163 component: Property,
164 },
165 {
166 name: "Properties",
167 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
168 parentName: "Properties",
169 under: "properties",
170 path: "/propertyView/:id",
171 component: PropertyView,
172 },
173 {
174 name: "Property Import",
175 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
176 both: true,
177 under: "properties",
178 parentName: "Properties",
179 path: "/propertyImport",
180 component: PropertyImport,
181 },
182
183 // -----------------------------Opportunities-------------------------------------
184 {
185 name: "Opportunities",
186 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
187 path: "/opportunities",
188 icon: <Icon as={TbBulb} width='20px' height='20px' color='inherit' />,
189 component: Opportunities,
190 },
191 {
192 name: "Opportunities",
193 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
194 path: "/opportunitiesView/:id",
195 under: "opportunities",
196 parentName: "Opportunities",
197 icon: <Icon as={TbBulb} width='20px' height='20px' color='inherit' />,
198 component: OpportunitiesView,
199 },
200 {
201 name: "Opportunities",
202 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
203 path: "/opprotunitiesImport",
204 under: "opportunities",
205 parentName: "Opportunities",
206 icon: <Icon as={TbBulb} width='20px' height='20px' color='inherit' />,
207 component: OpportunitiesImport,
208 },
209 // -----------------------------Account-------------------------------------
210 {
211 name: "Account",
212 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
213 path: "/account",
214 icon: <Icon as={RiAccountCircleFill} width='20px' height='20px' color='inherit' />,
215 component: Account,
216 },
217 {
218 name: "Account",
219 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
220 path: "/accountView/:id",
221 under: "account",
222 parentName: "Account",
223 icon: <Icon as={RiAccountCircleFill} width='20px' height='20px' color='inherit' />,
224 component: AccountView,
225 },
226 {
227 name: "Account",
228 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
229 path: "/accountImport",
230 under: "account",
231 parentName: "Account",
232 icon: <Icon as={RiAccountCircleFill} width='20px' height='20px' color='inherit' />,
233 component: AccountImport,
234 },
235 // --------------- Quotes Routes --------------------
236 {
237 name: "Quotes",
238 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
239 path: "/quotes",
240 icon: <Icon as={BsBlockquoteRight} width='20px' height='20px' color='inherit' />,
241 component: Quotes,
242 },
243 {
244 name: "Quotes",
245 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
246 under: "quotes",
247 parentName: "Quotes",
248 path: "/quotesView/:id",
249 component: QuotesView,
250 },
251 {
252 name: "Quotes Import",
253 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
254 both: true,
255 under: "quotes",
256 parentName: "Quotes",
257 path: "/quotesImport",
258 component: QuotesImport,
259 },
260 // --------------- Invoices Routes --------------------
261 {
262
263 name: "Invoices",
264 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
265 path: "/invoices",
266 icon: <Icon as={TbFileInvoice} width='20px' height='20px' color='inherit' />,
267 component: Invoices,
268 },
269 {
270 name: "Invoices",
271 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
272 under: "invoices",
273 parentName: "Invoices",
274 path: "/invoicesView/:id",
275 component: InvoicesView,
276 },
277 {
278 name: "Invoices Import",
279 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
280 both: true,
281 under: "invoices",
282 parentName: "Invoices",
283 path: "/invoicesImport",
284 component: InvoicesImport,
285 },
286
287 // // ------------- Communication Integration Routes ------------------------
288 // {
289 // name: "Communication Integration",
290 // layout: [ROLE_PATH.admin, ROLE_PATH.user],
291
292 // path: "/communication-integration",
293 // icon: <Icon as={GiSatelliteCommunication} width='20px' height='20px' color='inherit' />,
294 // component: Communication,
295 // },
296 // ------------- Task Routes ------------------------
297 {
298 name: "Tasks",
299 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
300 path: "/task",
301 icon: <Icon as={FaTasks} width='20px' height='20px' color='inherit' />,
302 component: Task,
303 },
304 {
305 name: "Tasks",
306 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
307 under: "task",
308 parentName: "Tasks",
309 path: "/view/:id",
310 component: TaskView,
311 },
312 // ------------- Meeting Routes ------------------------
313 {
314 name: "Meetings",
315 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
316 path: "/metting",
317 icon: <Icon as={SiGooglemeet} width='20px' height='20px' color='inherit' />,
318 component: Meeting,
319 },
320 {
321 name: "Meetings ",
322 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
323 under: "Meetings",
324 parentName: "Meetings",
325 path: "/metting/:id",
326 component: MettingView,
327 },
328 // ------------- Phone Routes ------------------------
329 {
330 name: "Calls",
331 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
332 path: "/phone-call",
333 icon: <Icon as={PiPhoneCallBold} width='20px' height='20px' color='inherit' />,
334 component: PhoneCall,
335 },
336 {
337 name: "Calls",
338 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
339 under: "phone-call",
340 parentName: "Calls",
341 path: "/phone-call/:id",
342 component: PhoneCallView,
343 },
344 // ------------- Email Routes------------------------
345 {
346 // separator: 'History',
347 name: "Emails",
348 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
349 path: "/email",
350 icon: <Icon as={AiOutlineMail} width='20px' height='20px' color='inherit' />,
351 component: EmailHistory,
352 },
353 {
354 name: "Emails ",
355 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
356 under: "Emails",
357 parentName: "Emails",
358 path: "/Email/:id",
359 component: EmailHistoryView,
360 },
361 // -----------------------------Email Template-------------------------------------
362 {
363 name: "Email Template",
364 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
365 path: "/email-template",
366 icon: <Icon as={HiTemplate} width='20px' height='20px' color='inherit' />,
367 component: EmailTemplate,
368 },
369 {
370 name: "Add Email Template",
371 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
372 under: "email-template",
373 parentName: "Email Template",
374 path: "/email-template/email-template-addEdit",
375 icon: <Icon as={HiTemplate} width='20px' height='20px' color='inherit' />,
376 component: AddEdit,
377 },
378 {
379 name: "Email Template",
380 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
381 under: "email-template",
382 parentName: "Email Template",
383 path: "/email-template/:id",
384 icon: <Icon as={HiTemplate} width='20px' height='20px' color='inherit' />,
385 component: templateView,
386 },
387 // ------------- Calender Routes ------------------------
388 {
389 name: "Calender",
390 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
391 path: "/calender",
392 icon: <Icon as={FaCalendarAlt} width='20px' height='20px' color='inherit' />,
393 component: Calender,
394 },
395 // ------------- Payments Routes ------------------------
396 {
397 name: "Payments",
398 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
399 path: "/payments",
400 icon: <Icon as={FaRupeeSign} width='20px' height='20px' color='inherit' />,
401 component: Payments,
402 },
403
404 // -----------------------------Admin setting-------------------------------------
405 {
406 name: "Admin Setting",
407 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
408 // parentName: "admin",
409 under: "admin",
410 path: "/admin-setting",
411 component: AdminSetting,
412 },
413 {
414 name: "Roles",
415 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
416 path: "/role",
417 under: "role",
418 icon: <Icon as={FaCreativeCommonsBy} width='20px' height='20px' color='inherit' />,
419 component: Role,
420 },
421 {
422 name: "Custom Fields",
423 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
424 path: "/custom-Fields",
425 under: "customField",
426 icon: <Icon as={FaWpforms} width='20px' height='20px' color='inherit' />,
427 component: CustomField,
428 },
429 {
430 name: "Change Images",
431 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
432 path: "/change-images",
433 under: "image",
434 icon: <Icon as={TbExchange} width='20px' height='20px' color='inherit' />,
435 component: ChangeImage,
436 },
437 {
438 name: "Validation",
439 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
440 path: "/validations",
441 under: "Validation",
442 icon: <Icon as={GrValidate} width='20px' height='20px' color='inherit' />,
443 component: Validation,
444 },
445 {
446 name: "Table Fields",
447 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
448 path: "/table-field",
449 under: "tableField",
450 icon: <Icon as={TbTableColumn} width='20px' height='20px' color='inherit' />,
451 component: TableField,
452 },
453 {
454 name: "Active Deactive Module",
455 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
456 path: "/active-deactive-module",
457 under: "activeDeactiveModule",
458 icon: <Icon as={TbTableColumn} width='20px' height='20px' color='inherit' />,
459 component: activeDeactiveModule,
460 },
461 {
462 name: "Module",
463 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
464 path: "/module",
465 under: "module",
466 icon: <Icon as={VscFileSubmodule} width='20px' height='20px' color='inherit' />,
467 component: module,
468 },
469 // // ------------- Text message Routes ------------------------
470 // {
471 // name: "Text Msg",
472 // layout: [ROLE_PATH.admin, ROLE_PATH.user],
473 //
474 // path: "/text-msg",
475 // icon: <Icon as={MdOutlineMessage} width='20px' height='20px' color='inherit' />,
476 // component: TextMsg,
477 // },
478 // {
479 // name: "Text Msg View",
480 // layout: [ROLE_PATH.admin, ROLE_PATH.user],
481 //
482 // under: "text-msg",
483 // path: text-msg/:id",
484 // component: TextMsgView,
485 // },
486 // ------------- Document Routes ------------------------
487 {
488 name: "Documents",
489 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
490 path: "/documents",
491 icon: <Icon as={AiFillFolderOpen} width='20px' height='20px' color='inherit' />,
492 component: Document,
493 },
494 // ----------------- Reporting Layout -----------------
495 {
496 name: "Reporting and Analytics",
497 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
498 path: "/reporting-analytics",
499 icon: <Icon as={MdInsertChartOutlined} width='20px' height='20px' color='inherit' />,
500 component: Report,
501 },
502 // ------------- user Routes ------------------------
503 {
504 name: "Users",
505 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
506 path: "/user",
507 under: "user",
508 icon: <Icon as={HiUsers} width='20px' height='20px' color='inherit' />,
509 component: User,
510 },
511 {
512 name: "User View",
513 layout: [ROLE_PATH.superAdmin, ROLE_PATH.user],
514 parentName: "Email",
515 under: "user",
516 path: "/userView/:id",
517 component: UserView,
518 },
519 // ========================== User layout ==========================
520
521 // ========================== auth layout ==========================
522 {
523 name: "Sign In",
524 layout: "/auth",
525 path: "/sign-in",
526 icon: <Icon as={MdLock} width='20px' height='20px' color='inherit' />,
527 component: SignInCentered,
528 },
529];
530
531export default routes;