import React from 'react';
import { Text, View, StyleSheet } from 'react-native';
import { Svg, Path, SvgProps } from 'react-native-svg';
import isNil from 'lodash-es/isNil';
import Loading from '../Loading';
import { useThemeFactory } from '../Theme';
import TouchableOpacity from '../TouchableOpacity';
import type { NumberKeyboardKeyProps } from './types';
import { createKeyStyle } from './style';
const CollapseIcon = (props: SvgProps) => (
);
const DeleteIcon = (props: SvgProps) => (
);
const NumberKeyboardKey: React.FC = props => {
const { children, loading, wider, color, onPress, text, type, large } = props;
const { styles, theme } = useThemeFactory(createKeyStyle);
const isBlue = color === 'blue';
const renderContent = () => {
const textStyle = StyleSheet.flatten([styles.text, isBlue && styles.blueText]);
if (loading) {
return ;
}
const actualText = children || text;
const textNode = !isNil(actualText) ? {actualText} : null;
switch (type) {
case 'delete':
return textNode || ;
case 'extra':
return textNode || ;
default:
return textNode;
}
};
return (
onPress?.(text, type)}
>
{renderContent()}
);
};
export default NumberKeyboardKey;