pokeballs.ts 894 Bytes
Newer Older
Michal Čaniga's avatar
Michal Čaniga committed
1
2
import { getDataByIds } from '../utils/dataUtils';

Michal Čaniga's avatar
Michal Čaniga committed
3
export type Pokeball = {
Michal Čaniga's avatar
Michal Čaniga committed
4
	id: number;
Michal Čaniga's avatar
Michal Čaniga committed
5
6
	name: string;
	price: number;
7
	catches: number;
Michal Čaniga's avatar
Michal Čaniga committed
8
	image?: string;
Michal Čaniga's avatar
Michal Čaniga committed
9
10
};

Michal Čaniga's avatar
Michal Čaniga committed
11
export const pokeballs: Pokeball[] = [
12
13
	{
		id: 1,
Michal Čaniga's avatar
Michal Čaniga committed
14
15
		name: 'Weak Pokeball',
		price: 180,
16
		catches: 1,
Michal Čaniga's avatar
Michal Čaniga committed
17
18
19
20
21
22
23
24
		image:
			'https://st2.depositphotos.com/3213441/12022/v/600/depositphotos_120226152-stock-illustration-pokemon-go-pokeball-round-sign.jpg'
	},
	{
		id: 2,
		name: 'Regular Pokeball',
		price: 263,
		catches: 2,
25
26
		image: 'https://www.downloadclipart.net/large/pokeball-png-photos.png'
	},
Michal Čaniga's avatar
Michal Čaniga committed
27
28
29
30
31
32
33
34
	{
		id: 3,
		name: 'Strong Pokeball',
		price: 394,
		catches: 3,
		image:
			'https://www.pngitem.com/pimgs/m/135-1351704_pokeball-png-image-poke-ball-clip-art-transparent.png'
	}
Michal Čaniga's avatar
Michal Čaniga committed
35
36
];

Michal Čaniga's avatar
Michal Čaniga committed
37
38
export const getUserPokeballs = (pokeballIds?: number[]): Pokeball[] | null =>
	pokeballIds !== undefined ? getDataByIds(pokeballs, pokeballIds) : null;