pokeballs.ts 520 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
14
	{ id: 1, name: 'Pokeball 1', price: 12, catches: 1 },
	{ id: 2, name: 'Pokeball 2', price: 48, catches: 2 },
	{ id: 3, name: 'Pokeball 3', price: 19, catches: 3 }
Michal Čaniga's avatar
Michal Čaniga committed
15
16
];

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