import { Pressable, StyleSheet, Text, View } from 'react-native' import { colors, radii, spacing, typography } from '../theme/mobile-theme' const BROWSER_KEYS = ['Enter', 'Backspace', 'Tab', 'Escape'] as const type Props = { disabled: boolean onKeypress: (key: string) => void } export function MobileBrowserKeyRow({ disabled, onKeypress }: Props): React.JSX.Element { return ( {BROWSER_KEYS.map((key) => ( [ styles.keyButton, pressed && styles.keyButtonPressed, disabled && styles.disabled ]} disabled={disabled} onPress={() => onKeypress(key)} > {key === 'Backspace' ? '⌫' : key === 'Escape' ? 'Esc' : key} ))} ) } const styles = StyleSheet.create({ keyRow: { flexDirection: 'row', gap: spacing.xs, paddingHorizontal: spacing.sm, paddingTop: spacing.xs }, keyButton: { minHeight: 30, minWidth: 42, alignItems: 'center', justifyContent: 'center', borderRadius: radii.button, backgroundColor: colors.bgRaised, paddingHorizontal: spacing.sm }, keyButtonPressed: { backgroundColor: colors.borderSubtle }, keyButtonText: { color: colors.textSecondary, fontSize: 12, fontFamily: typography.monoFamily }, disabled: { opacity: 0.35 }, disabledText: { color: colors.textMuted } })