-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathErrorPage.tsx
More file actions
37 lines (32 loc) · 847 Bytes
/
ErrorPage.tsx
File metadata and controls
37 lines (32 loc) · 847 Bytes
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
import pets from '/src/assets/images/pets.png';
const mapping = new Map<number, string>([
[1,"Dogs"],
[2,"Cats"],
[3,"Horses"],
[4,"Iguanas"],
[5,"Goblin Sharks"]
])
export const ErrorPage = () => {
const renderListItem = (index: number) => {
const item = mapping.get(index);
if(!item){
throw new Error(`No mapping found for index: ${index}`);
}
return (
<li>{item}</li>
)
}
return (
<>
<div className="row">
<div className="col-md-12">
<img className="img-responsive" src={pets} />
</div>
</div>
<h3>We currently work with the following animal species:</h3>
<ol>
{[1,2,3,4,5,6].map(i => renderListItem(i))}
</ol>
</>
);
};