import Ionicons from "@expo/vector-icons/Ionicons"; export type MaybeArray = T | T[]; export const wrap = (value: MaybeArray): T[] => Array.isArray(value) ? value : [value]; type IconName = keyof (typeof Ionicons)["glyphMap"]; const mapping: Record = { deposit: "bonfire-sharp", invoice: "document", payment: "compass", withdrawal: "caret-down", }; export const mapTransactionTypeToIcon = (value: string): IconName => mapping[value];