1 | import { useMemo } from 'react';
|
---|
2 | // routes
|
---|
3 | import { paths } from 'src/routes/paths';
|
---|
4 | // components
|
---|
5 | import SvgColor from 'src/components/svg-color';
|
---|
6 |
|
---|
7 | // ----------------------------------------------------------------------
|
---|
8 |
|
---|
9 | const icon = (name: string) => (
|
---|
10 | <SvgColor src={`/assets/icons/navbar/${name}.svg`} sx={{ width: 1, height: 1 }} />
|
---|
11 | // OR
|
---|
12 | // <Iconify icon="fluent:mail-24-filled" />
|
---|
13 | // https://icon-sets.iconify.design/solar/
|
---|
14 | // https://www.streamlinehq.com/icons
|
---|
15 | );
|
---|
16 |
|
---|
17 | const ICONS = {
|
---|
18 | job: icon('ic_job'),
|
---|
19 | blog: icon('ic_blog'),
|
---|
20 | chat: icon('ic_chat'),
|
---|
21 | mail: icon('ic_mail'),
|
---|
22 | user: icon('ic_user'),
|
---|
23 | file: icon('ic_file'),
|
---|
24 | lock: icon('ic_lock'),
|
---|
25 | tour: icon('ic_tour'),
|
---|
26 | order: icon('ic_order'),
|
---|
27 | label: icon('ic_label'),
|
---|
28 | blank: icon('ic_blank'),
|
---|
29 | kanban: icon('ic_kanban'),
|
---|
30 | folder: icon('ic_folder'),
|
---|
31 | banking: icon('ic_banking'),
|
---|
32 | booking: icon('ic_booking'),
|
---|
33 | invoice: icon('ic_invoice'),
|
---|
34 | product: icon('ic_product'),
|
---|
35 | calendar: icon('ic_calendar'),
|
---|
36 | disabled: icon('ic_disabled'),
|
---|
37 | external: icon('ic_external'),
|
---|
38 | menuItem: icon('ic_menu_item'),
|
---|
39 | ecommerce: icon('ic_ecommerce'),
|
---|
40 | analytics: icon('ic_analytics'),
|
---|
41 | dashboard: icon('ic_dashboard'),
|
---|
42 | };
|
---|
43 |
|
---|
44 | // ----------------------------------------------------------------------
|
---|
45 |
|
---|
46 | export function useNavData() {
|
---|
47 | const data = useMemo(
|
---|
48 | () => [
|
---|
49 | // OVERVIEW
|
---|
50 | // ----------------------------------------------------------------------
|
---|
51 | {
|
---|
52 | subheader: 'analytics',
|
---|
53 | items: [
|
---|
54 | {
|
---|
55 | title: 'dashboard',
|
---|
56 | path: paths.dashboard.banking,
|
---|
57 | icon: ICONS.banking,
|
---|
58 | },
|
---|
59 | ],
|
---|
60 | },
|
---|
61 |
|
---|
62 | // MANAGEMENT
|
---|
63 | // ----------------------------------------------------------------------
|
---|
64 | {
|
---|
65 | subheader: 'management',
|
---|
66 | items: [
|
---|
67 | // INVOICE
|
---|
68 | {
|
---|
69 | title: 'invoice',
|
---|
70 | path: paths.dashboard.invoice.root,
|
---|
71 | icon: ICONS.invoice,
|
---|
72 | children: [
|
---|
73 | { title: 'list', path: paths.dashboard.invoice.root },
|
---|
74 | { title: 'create', path: paths.dashboard.invoice.new },
|
---|
75 | ],
|
---|
76 | },
|
---|
77 | // CUSTOMER
|
---|
78 | {
|
---|
79 | title: 'customer',
|
---|
80 | path: paths.dashboard.customer.list,
|
---|
81 | icon: ICONS.user,
|
---|
82 | children: [
|
---|
83 | { title: 'list', path: paths.dashboard.customer.list },
|
---|
84 | { title: 'create', path: paths.dashboard.customer.new },
|
---|
85 | ],
|
---|
86 | },
|
---|
87 | {
|
---|
88 | title: 'Employees',
|
---|
89 | path: paths.dashboard.employee.list,
|
---|
90 | icon: <SvgColor src="/assets/icons/navbar/ic_user.svg" />,
|
---|
91 | children: [
|
---|
92 | { title: 'list', path: paths.dashboard.employee.list },
|
---|
93 | { title: 'create', path: paths.dashboard.employee.new },
|
---|
94 | ],
|
---|
95 | },
|
---|
96 | ],
|
---|
97 | },
|
---|
98 | ],
|
---|
99 | []
|
---|
100 | );
|
---|
101 |
|
---|
102 | return data;
|
---|
103 | }
|
---|