import {Image} from 'expo-image' import {useLingui} from '@lingui/react/macro' import {atoms as a, useTheme} from '#/alf' import {Button} from '#/components/Button' import {useAnalytics} from '#/analytics' import {type Gif} from '#/features/gifPicker/types' import {gifPreviewUrl} from '#/features/gifPicker/utils' export function GifPickerItem({ gif, onSelectGif, }: { gif: Gif onSelectGif: (gif: Gif) => void }) { const ax = useAnalytics() const {t: l} = useLingui() const t = useTheme() const [width, height] = gif.media_formats.tinygif.dims const aspectRatio = width > 0 && height > 0 ? width / height : 1 const onPress = () => { ax.metric('composer:gif:select', {}) onSelectGif(gif) } return ( ) }