-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlocalStorage.jsx
More file actions
373 lines (365 loc) · 9.58 KB
/
localStorage.jsx
File metadata and controls
373 lines (365 loc) · 9.58 KB
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
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
localStorage.clear()
const employees = [
{
"id": 1,
"firstname": "Aarav",
"email": "employee1@example.com",
"password": "123",
"tasks": [
{
"active": true,
"new_task": true,
"completed": false,
"failed": false,
"title": "Prepare sales report",
"description": "Compile the monthly sales figures into the report template.",
"date": "2025-08-15",
"category": "Sales"
},
{
"active": false,
"new_task": false,
"completed": true,
"failed": false,
"title": "Update client database",
"description": "Ensure client contact information is current.",
"date": "2025-08-10",
"category": "Database"
},
{
"active": false,
"new_task": false,
"completed": false,
"failed": true,
"title": "Submit expense claims",
"description": "File expense claims for last month's travel.",
"date": "2025-08-05",
"category": "Finance"
}
],
"taskCounts": {
"active": 1,
"new_task": 2,
"completed": 1,
"failed": 1
}
},
{
"id": 2,
"firstname": "Ishita",
"email": "employee2@example.com",
"password": "123",
"tasks": [
{
"active": true,
"new_task": true,
"completed": false,
"failed": false,
"title": "Design landing page",
"description": "Create the mockup for the new marketing campaign landing page.",
"date": "2025-08-14",
"category": "Design"
},
{
"active": true,
"new_task": true,
"completed": false,
"failed": false,
"title": "UI Prototype Update",
"description": "Refine the new prototype based on stakeholder feedback.",
"date": "2025-08-15",
"category": "Design"
},
{
"active": false,
"new_task": false,
"completed": true,
"failed": false,
"title": "Review UI components",
"description": "Audit the existing component library for outdated elements.",
"date": "2025-08-07",
"category": "Design"
},
{
"active": false,
"new_task": false,
"completed": false,
"failed": true,
"title": "Fix login bug",
"description": "Resolve the issue preventing users from logging in.",
"date": "2025-08-06",
"category": "Development"
},
{
"active": false,
"new_task": false,
"completed": true,
"failed": false,
"title": "Team feedback session",
"description": "Collect feedback from team members on new project tools.",
"date": "2025-08-08",
"category": "HR"
}
],
"taskCounts": {
"active": 2,
"new_task": 2,
"completed": 2,
"failed": 1
}
},
{
"id": 3,
"firstname": "Karan",
"email": "employee3@example.com",
"password": "123",
"tasks": [
{
"active": true,
"new_task": true,
"completed": false,
"failed": false,
"title": "Draft policy update",
"description": "Update the remote work policy document.",
"date": "2025-08-12",
"category": "Administration"
},
{
"active": false,
"new_task": false,
"completed": true,
"failed": false,
"title": "Backup server data",
"description": "Ensure weekly backups are completed successfully.",
"date": "2025-08-09",
"category": "IT"
},
{
"active": false,
"new_task": false,
"completed": false,
"failed": true,
"title": "Inventory audit",
"description": "Count and verify office supply inventory.",
"date": "2025-08-04",
"category": "Logistics"
}
],
"taskCounts": {
"active": 2,
"new_task": 0,
"completed": 1,
"failed": 1
}
},
{
"id": 4,
"firstname": "Meera",
"email": "employee4@example.com",
"password": "123",
"tasks": [
{
"active": true,
"new_task": true,
"completed": false,
"failed": false,
"title": "Write press release",
"description": "Announce the company's new service offering.",
"date": "2025-08-16",
"category": "Marketing"
},
{
"active": true,
"new_task": true,
"completed": false,
"failed": false,
"title": "Campaign brainstorming",
"description": "Plan creative ideas for the festive campaign.",
"date": "2025-08-15",
"category": "Marketing"
},
{
"active": false,
"new_task": false,
"completed": true,
"failed": false,
"title": "Social media posts",
"description": "Schedule posts for the next week on all platforms.",
"date": "2025-08-11",
"category": "Marketing"
},
{
"active": false,
"new_task": false,
"completed": false,
"failed": true,
"title": "Update brand guidelines",
"description": "Incorporate the latest design changes.",
"date": "2025-08-05",
"category": "Design"
}
],
"taskCounts": {
"active": 2,
"new_task": 0,
"completed": 1,
"failed": 1
}
},
{
"id": 5,
"firstname": "Rohit",
"email": "employee5@example.com",
"password": "123",
"tasks": [
{
"active": true,
"new_task": true,
"completed": false,
"failed": false,
"title": "Plan quarterly meeting",
"description": "Organize agenda and invite speakers.",
"date": "2025-08-18",
"category": "Management"
},
{
"active": false,
"new_task": false,
"completed": true,
"failed": false,
"title": "Review budget proposals",
"description": "Analyze and approve departmental budgets.",
"date": "2025-08-07",
"category": "Finance"
},
{
"active": false,
"new_task": false,
"completed": false,
"failed": true,
"title": "Contract review",
"description": "Go through legal contracts for compliance.",
"date": "2025-08-06",
"category": "Legal"
}
],
"taskCounts": {
"active": 1,
"new_task": 1,
"completed": 2,
"failed": 1
}
},
{
"id": 6,
"firstname": "Sneha",
"email": "employee6@example.com",
"password": "123",
"tasks": [
{
"active": true,
"new_task": true,
"completed": false,
"failed": false,
"title": "Security audit",
"description": "Check all systems for security vulnerabilities.",
"date": "2025-08-15",
"category": "IT"
},
{
"active": true,
"new_task": true,
"completed": false,
"failed": false,
"title": "System monitoring",
"description": "Set up real-time monitoring for servers.",
"date": "2025-08-16",
"category": "IT"
},
{
"active": false,
"new_task": false,
"completed": true,
"failed": false,
"title": "Deploy new CRM",
"description": "Install and configure the new CRM system.",
"date": "2025-08-10",
"category": "IT"
},
{
"active": false,
"new_task": false,
"completed": false,
"failed": true,
"title": "Train new hires",
"description": "Conduct training for the onboarding batch.",
"date": "2025-08-04",
"category": "HR"
}
],
"taskCounts": {
"active": 2,
"new_task": 2,
"completed": 1,
"failed": 1
}
},
{
"id": 7,
"firstname": "Priya",
"email": "employee7@example.com",
"password": "123",
"tasks": [
{
"active": true,
"new_task": true,
"completed": false,
"failed": false,
"title": "Market research",
"description": "Analyze competitor strategies in the new region.",
"date": "2025-08-17",
"category": "Research"
},
{
"active": false,
"new_task": false,
"completed": true,
"failed": false,
"title": "Product testing",
"description": "Evaluate beta version of new software.",
"date": "2025-08-08",
"category": "QA"
},
{
"active": false,
"new_task": false,
"completed": false,
"failed": true,
"title": "Vendor negotiation",
"description": "Negotiate contract terms with supplier.",
"date": "2025-08-05",
"category": "Procurement"
}
],
"taskCounts": {
"active": 1,
"new_task": 0,
"completed": 1,
"failed": 2
}
}
]
const admin=[{
"id": 1,
"email": "admin@example.com",
"password": "123"
}];
export const setLocalStorage=()=>{
localStorage.setItem('employees',JSON.stringify(employees))
localStorage.setItem('admin',JSON.stringify(admin))
}
export const getLocalStorage=()=>{
const employees=JSON.parse(localStorage.getItem('employees'))
const admin=JSON.parse(localStorage.getItem('admin'))
return {employees,admin}
}