import React, { useCallback, useMemo } from 'react'; import { StyleSheet, View } from 'react-native'; import { useTheme } from '../../contexts/themeContext/ThemeContext'; import { IconProps } from '../../icons'; import { Button, ButtonProps } from '../ui'; export type ReactionButtonProps = { /** * Icon to display for the reaction button */ Icon: React.ComponentType; /** * Whether the reaction button is selected */ selected: boolean; /** * The type of reaction */ type: string; /** * Function to call when the reaction button is pressed * @param reactionType * @returns */ onPress?: (reactionType: string) => void; count?: string; size?: ButtonProps['size']; }; export const ReactionButton = (props: ReactionButtonProps) => { const { Icon, onPress, selected, type, size, count } = props; const { theme: { messageMenu: { reactionPicker: { reactionIconSize }, }, }, } = useTheme(); const styles = useStyles(!!count); const onPressHandler = () => { if (onPress) { onPress(type); } }; const EmojiIcon = useCallback( () => , [Icon, reactionIconSize], ); return (