| 1 | |
| 2 | import { Icon } from "@chakra-ui/react"; |
| 3 | import { HiUsers } from "react-icons/hi"; |
| 4 | import { |
| 5 | MdContacts, |
| 6 | MdHome, |
| 7 | MdInsertChartOutlined, |
| 8 | MdLeaderboard, |
| 9 | MdLock |
| 10 | } from "react-icons/md"; |
| 11 | |
| 12 | import React from "react"; |
| 13 | import { AiFillFolderOpen, AiOutlineMail } from "react-icons/ai"; |
| 14 | import { FaCalendarAlt, FaRupeeSign, FaTasks, FaWpforms } from "react-icons/fa"; |
| 15 | import { LuBuilding2 } from "react-icons/lu"; |
| 16 | import { PiPhoneCallBold } from "react-icons/pi"; |
| 17 | import { FaCreativeCommonsBy } from "react-icons/fa"; |
| 18 | import { SiGooglemeet } from "react-icons/si"; |
| 19 | import { ROLE_PATH } from "./roles"; |
| 20 | import ChangeImage from "views/admin/image"; |
| 21 | import Validation from "views/admin/validation"; |
| 22 | import CustomField from "views/admin/customField"; |
| 23 | import TableField from "views/admin/tableField"; |
| 24 | import activeDeactiveModule from "views/admin/activeDeactiveModule"; |
| 25 | import { TbExchange, TbTableColumn } from "react-icons/tb"; |
| 26 | import { GrValidate } from "react-icons/gr"; |
| 27 | import { VscFileSubmodule } from "react-icons/vsc"; |
| 28 | import { HiTemplate } from "react-icons/hi"; |
| 29 | import { TbBulb } from "react-icons/tb"; |
| 30 | import { BsBlockquoteRight } from "react-icons/bs"; |
| 31 | import { RiAccountCircleFill } from "react-icons/ri"; |
| 32 | import { TbInvoice } from "react-icons/tb"; |
| 33 | import { TbFileInvoice } from "react-icons/tb"; |
| 34 | |
| 35 | const MainDashboard = React.lazy(() => import("views/admin/default")); |
| 36 | |
| 37 | |
| 38 | const Contact = React.lazy(() => import('views/admin/contact')); |
| 39 | const ContactView = React.lazy(() => import('views/admin/contact/View')); |
| 40 | const ContactImport = React.lazy(() => import("views/admin/contact/components/ContactImport")); |
| 41 | |
| 42 | const Quotes = React.lazy(() => import('views/admin/quotes')); |
| 43 | const QuotesView = React.lazy(() => import('views/admin/quotes/View')); |
| 44 | const QuotesImport = React.lazy(() => import("views/admin/quotes/components/QuotesImport")); |
| 45 | |
| 46 | const Invoices = React.lazy(() => import('views/admin/invoice')); |
| 47 | const InvoicesView = React.lazy(() => import('views/admin/invoice/View')); |
| 48 | const InvoicesImport = React.lazy(() => import("views/admin/invoice/components/InvoiceImport")); |
| 49 | |
| 50 | const User = React.lazy(() => import("views/admin/users")); |
| 51 | const UserView = React.lazy(() => import("views/admin/users/View")); |
| 52 | |
| 53 | const Property = React.lazy(() => import("views/admin/property")); |
| 54 | const PropertyView = React.lazy(() => import("views/admin/property/View")); |
| 55 | const PropertyImport = React.lazy(() => import("views/admin/property/components/PropertyImport")) |
| 56 | |
| 57 | const Lead = React.lazy(() => import("views/admin/lead")); |
| 58 | const LeadView = React.lazy(() => import("views/admin/lead/View")); |
| 59 | const LeadImport = React.lazy(() => import("views/admin/lead/components/LeadImport")); |
| 60 | |
| 61 | const Communication = React.lazy(() => import("views/admin/communication")); |
| 62 | |
| 63 | const Task = React.lazy(() => import("views/admin/task")); |
| 64 | const TaskView = React.lazy(() => import("views/admin/task/components/taskView")); |
| 65 | const Calender = React.lazy(() => import("views/admin/calender")); |
| 66 | const Payments = React.lazy(() => import("views/admin/payments")); |
| 67 | const Role = React.lazy(() => import("views/admin/role")); |
| 68 | |
| 69 | const Document = React.lazy(() => import("views/admin/document")); |
| 70 | |
| 71 | const EmailHistory = React.lazy(() => import("views/admin/emailHistory")); |
| 72 | const EmailHistoryView = React.lazy(() => import("views/admin/emailHistory/View")); |
| 73 | |
| 74 | const Meeting = React.lazy(() => import("views/admin/meeting")); |
| 75 | const MettingView = React.lazy(() => import("views/admin/meeting/View")); |
| 76 | |
| 77 | const PhoneCall = React.lazy(() => import("views/admin/phoneCall")); |
| 78 | const PhoneCallView = React.lazy(() => import("views/admin/phoneCall/View")); |
| 79 | |
| 80 | const Report = React.lazy(() => import("views/admin/reports")); |
| 81 | const EmailTemplate = React.lazy(() => import("views/admin/emailTemplate")); |
| 82 | const AddEdit = React.lazy(() => import("views/admin/emailTemplate/AddEdit")); |
| 83 | const templateView = React.lazy(() => import("views/admin/emailTemplate/view.js")); |
| 84 | |
| 85 | |
| 86 | const SignInCentered = React.lazy(() => import("views/auth/signIn")); |
| 87 | |
| 88 | const AdminSetting = React.lazy(() => import("views/admin/adminSetting")); |
| 89 | const validation = React.lazy(() => import("views/admin/validation")); |
| 90 | const module = React.lazy(() => import("views/admin/moduleName")); |
| 91 | const Opportunities = React.lazy(() => import("views/admin/opportunities")); |
| 92 | const OpportunitiesView = React.lazy(() => import("views/admin/opportunities/View")); |
| 93 | const OpportunitiesImport = React.lazy(() => import("views/admin/opportunities/components/OpprtunityImport")); |
| 94 | const Account = React.lazy(() => import("views/admin/account")); |
| 95 | const AccountView = React.lazy(() => import("views/admin/account/View")); |
| 96 | const AccountImport = React.lazy(() => import("views/admin/account/components/AccountImport")); |
| 97 | |
| 98 | const routes = [ |
| 99 | |
| 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 | |
| 108 | |
| 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 | |
| 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 | |
| 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 | |
| 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 | |
| 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 | |
| 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 | |
| 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 | |
| 288 | |
| 289 | |
| 290 | |
| 291 | |
| 292 | |
| 293 | |
| 294 | |
| 295 | |
| 296 | |
| 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 | |
| 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 | |
| 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 | |
| 345 | { |
| 346 | |
| 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 | |
| 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 | |
| 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 | |
| 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 | |
| 405 | { |
| 406 | name: "Admin Setting", |
| 407 | layout: [ROLE_PATH.superAdmin, ROLE_PATH.user], |
| 408 | |
| 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 | |
| 470 | |
| 471 | |
| 472 | |
| 473 | |
| 474 | |
| 475 | |
| 476 | |
| 477 | |
| 478 | |
| 479 | |
| 480 | |
| 481 | |
| 482 | |
| 483 | |
| 484 | |
| 485 | |
| 486 | |
| 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 | |
| 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 | |
| 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 | |
| 520 | |
| 521 | |
| 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 | |
| 531 | export default routes; |