import type { IconName } from "@fortawesome/fontawesome-svg-core" import { FontAwesomeIcon } from "@fortawesome/react-native-fontawesome" import React, { memo } from "react" import { View } from "react-native" import { ActivityIndicator, IconButton, Text } from "react-native-paper" export interface IconsListProps { selectedIcon?: string possibleIcons: string[] isLoading?: boolean handleIconSelect: (icon: string) => void } const IconsListWithoutMemo: React.FC = (props) => { const { selectedIcon, possibleIcons, isLoading = false, handleIconSelect, } = props if (possibleIcons.length <= 0) { return ( {isLoading ? ( ) : ( No results found )} ) } return ( {possibleIcons.map((icon) => { return ( { return ( ) }} size={30} onPress={() => { handleIconSelect(icon) }} /> ) })} ) } export const IconsList = memo(IconsListWithoutMemo)