ICS React Native App
1import Ionicons from "@expo/vector-icons/Ionicons";
2
3export type MaybeArray<T> = T | T[];
4
5export const wrap = <T>(value: MaybeArray<T>): T[] =>
6 Array.isArray(value) ? value : [value];
7
8type IconName = keyof (typeof Ionicons)["glyphMap"];
9
10const mapping: Record<string, IconName> = {
11 deposit: "bonfire-sharp",
12 invoice: "document",
13 payment: "compass",
14 withdrawal: "caret-down",
15};
16
17export const mapTransactionTypeToIcon = (value: string): IconName =>
18 mapping[value];