import { memo, useCallback } from 'react'; import { useAnalytics } from '../../core/analytics/hooks/useAnalytics'; import { FundEvent } from '../../core/analytics/types'; import { cn, pressable, text } from '../../styles/theme'; import type { FundCardPaymentMethodSelectRowProps } from '../types'; import { FundCardPaymentMethodImage } from './FundCardPaymentMethodImage'; export const FundCardPaymentMethodSelectRow = memo( ({ paymentMethod, onClick, hideImage, hideDescription, disabled, disabledReason, testId, }: FundCardPaymentMethodSelectRowProps) => { const { sendAnalytics } = useAnalytics(); const handleOnClick = useCallback(() => { if (!disabled) { onClick?.(paymentMethod); sendAnalytics(FundEvent.FundOptionSelected, { option: paymentMethod.id, }); } }, [disabled, onClick, paymentMethod, sendAnalytics]); return ( ); }, ); FundCardPaymentMethodSelectRow.displayName = 'FundCardPaymentMethodSelectRow';