import { Pressable, StyleSheet, type StyleProp, type ViewStyle } from 'react-native' import type { ReactNode } from 'react' import { colors, radii } from '../theme/mobile-theme' type Props = { children: ReactNode disabled?: boolean label: string onPress: () => void style?: StyleProp } export function MobileBrowserToolbarIconButton({ children, disabled, label, onPress, style }: Props): React.JSX.Element { return ( [ styles.button, style, pressed && !disabled && styles.buttonPressed, disabled && styles.disabled ]} disabled={disabled} onPress={onPress} accessibilityLabel={label} > {children} ) } const styles = StyleSheet.create({ button: { width: 26, height: 26, borderRadius: radii.button, alignItems: 'center', justifyContent: 'center' }, buttonPressed: { backgroundColor: colors.bgRaised }, disabled: { opacity: 0.35 } })