<commit_before>import React from 'react';
import { useIconComponents } from '@wq/react';
import { Button as PaperButton } from 'react-native-paper';
import PropTypes from 'prop-types';

export default function Button({
    onClick,
    onPress,
    variant,
    mode,
    icon,
    ...rest
}) {
    const { [icon]: Icon } = useIconComponents();
    if (!onPress) {
        onPress = onClick;
    }
    if (!mode) {
        mode = variant;
    }
    return <PaperButton onPress={onPress} mode={mode} icon={Icon} {...rest} />;
}

Button.propTypes = {
    onClick: PropTypes.func,
    onPress: PropTypes.func,
    variant: PropTypes.string,
    mode: PropTypes.string,
    icon: PropTypes.string
};<commit_msg>translate <Button color> for native<commit_after>import React from 'react';
import { useIconComponents } from '@wq/react';
import { Button as PaperButton, useTheme } from 'react-native-paper';
import PropTypes from 'prop-types';

export default function Button({
    onClick,
    onPress,
    variant,
    mode,
    icon,
    color,
    ...rest
}) {
    const { [icon]: Icon } = useIconComponents(),
        theme = useTheme();
    if (!onPress) {
        onPress = onClick;
    }
    if (!mode) {
        mode = variant;
    }
    if (color === 'primary') {
        color = theme.colors.primary;
    } else if (color === 'secondary') {
        color = theme.colors.accent;
    }
    return (
        <PaperButton
            onPress={onPress}
            mode={mode}
            icon={Icon}
            color={color}
            {...rest}
        />
    );
}

Button.propTypes = {
    onClick: PropTypes.func,
    onPress: PropTypes.func,
    variant: PropTypes.string,
    mode: PropTypes.string,
    icon: PropTypes.string,
    color: PropTypes.string
};
{'fraction_non_alphanumeric': 0.1349206349206349, 'fraction_numerical': 0.0, 'mean_word_length': 2.3877159309021114, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4548581', 'n_tokens_mistral': 524, 'n_tokens_neox': 540, 'n_words': 136}