Skip to content

Commit a488c82

Browse files
committed
Setting type of linkMap instead of casting every item
1 parent ffea7f4 commit a488c82

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

src/components/shared/MainNav.tsx

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const MainNav = ({
6767
links: (React.ComponentProps<typeof MainNavLink> & {accessRole: string})[]
6868
}
6969

70-
const linkMap = {
70+
const linkMap: { [key: string]: linkMapItem } = {
7171
"events": {
7272
links: [
7373
{
@@ -83,81 +83,81 @@ const MainNav = ({
8383
className: "events",
8484
}
8585
]
86-
} as linkMapItem,
86+
},
8787
"recordings": {
8888
links: [
8989
{
9090
path: "/recordings/recordings",
9191
accessRole: "ROLE_UI_LOCATIONS_VIEW",
92-
tooltipTitle: "NAV.CAPTUREAGENTS.TITLE" as ParseKeys,
92+
tooltipTitle: "NAV.CAPTUREAGENTS.TITLE",
9393
className: "recordings",
9494
}
9595
]
96-
} as linkMapItem,
96+
},
9797
"systems": {
9898
links: [
9999
{
100100
path: "/systems/jobs",
101101
accessRole: "ROLE_UI_JOBS_VIEW",
102-
tooltipTitle: "NAV.SYSTEMS.TITLE" as ParseKeys,
102+
tooltipTitle: "NAV.SYSTEMS.TITLE",
103103
className: "systems"
104104
},
105105
{
106106
path: "/systems/servers",
107107
accessRole: "ROLE_UI_SERVERS_VIEW",
108-
tooltipTitle: "NAV.SYSTEMS.TITLE" as ParseKeys,
108+
tooltipTitle: "NAV.SYSTEMS.TITLE",
109109
className: "systems"
110110
},
111111
{
112112
path: "/systems/services",
113113
accessRole: "ROLE_UI_SERVICES_VIEW",
114-
tooltipTitle: "NAV.SYSTEMS.TITLE" as ParseKeys,
114+
tooltipTitle: "NAV.SYSTEMS.TITLE",
115115
className: "systems"
116116
}
117117
]
118-
} as linkMapItem,
118+
},
119119
"users": {
120120
links: [
121121
{
122122
path: "/users/users",
123123
accessRole: "ROLE_UI_USERS_VIEW",
124-
tooltipTitle: "NAV.USERS.TITLE" as ParseKeys,
124+
tooltipTitle: "NAV.USERS.TITLE",
125125
className: "users"
126126
},
127127
{
128128
path: "/users/groups",
129129
accessRole: "ROLE_UI_GROUPS_VIEW",
130-
tooltipTitle: "NAV.USERS.TITLE" as ParseKeys,
130+
tooltipTitle: "NAV.USERS.TITLE",
131131
className: "users"
132132
},
133133
{
134134
path: "/users/acls",
135135
accessRole: "ROLE_UI_ACLS_VIEW",
136-
tooltipTitle: "NAV.USERS.TITLE" as ParseKeys,
136+
tooltipTitle: "NAV.USERS.TITLE",
137137
className: "users"
138138
}
139139
]
140-
} as linkMapItem,
140+
},
141141
"configuration": {
142142
links: [
143143
{
144144
path: "/configuration/themes",
145145
accessRole: "ROLE_UI_THEMES_VIEW",
146-
tooltipTitle: "NAV.CONFIGURATION.TITLE" as ParseKeys,
146+
tooltipTitle: "NAV.CONFIGURATION.TITLE",
147147
className: "configuration"
148148
}
149149
]
150-
} as linkMapItem,
150+
},
151151
"statistics": {
152152
links: [
153153
{
154154
path: "/statistics/organization",
155155
accessRole: "ROLE_UI_STATISTICS_ORGANIZATION_VIEW",
156-
tooltipTitle: "NAV.STATISTICS.TITLE" as ParseKeys,
156+
tooltipTitle: "NAV.STATISTICS.TITLE",
157157
className: "statistics"
158158
}
159159
]
160-
} as linkMapItem
160+
}
161161
};
162162

163163
// Link arrays containing more than one link must be sorted so that the

0 commit comments

Comments
 (0)