import type { IconName } from "@fortawesome/fontawesome-svg-core" import { FontAwesomeIcon } from "@fortawesome/react-native-fontawesome" import React, { memo } from "react" import { View, StyleSheet } from "react-native" import { IconButton, Text } from "react-native-paper" export interface HabitIconListProps { selectedIcon?: string possibleIcons: string[] handleIconSelect: (icon: string) => void } const HabitIconListWithoutMemo: React.FC = (props) => { const { selectedIcon, possibleIcons, handleIconSelect } = props if (possibleIcons.length > 0) { return ( {possibleIcons.map((icon) => { return ( { return ( ) }} size={30} onPress={() => { handleIconSelect(icon) }} /> ) })} ) } return ( No results found ) } const styles = StyleSheet.create({ noResults: { marginTop: 20, alignItems: "center", }, }) export const HabitIconList = memo(HabitIconListWithoutMemo)