import React, { useEffect, useRef } from 'react'; import { Box, Button, Icon, IconButton, Icons, Text, color, config, toRem } from 'folds'; type TapToSendBarProps = { previewUrl?: string; label: string; onSend: () => void; onCancel: () => void; }; /** * [Gitea #147] Fat-finger guard for touch screens: the first tap on a sticker * or GIF parks it here with a preview; "Send" (or a second tap on the same * item) sends it. */ export function TapToSendBar({ previewUrl, label, onSend, onCancel }: TapToSendBarProps) { const liveRef = useRef(null); useEffect(() => { liveRef.current?.focus?.(); }, [label]); return ( {previewUrl && ( )} Tap again to send {label} ); }