import {FC} from "react";
import {StyleSheet, TouchableOpacity, Text, View, StyleProp, ViewStyle, GestureResponderEvent} from "react-native";
import {responsiveHeight, responsiveWidth} from "react-native-responsive-dimensions";
import {RFPercentage} from "react-native-responsive-fontsize";
import DText from "../DText/DText";

type Props = {
    label: string;
    style?: StyleProp<ViewStyle>;
    isUnset?: boolean;
    onPress?: (event: GestureResponderEvent) => void
};

const BasicButton: FC<Props> = ({label, onPress, style, isUnset = false}) => {
    return (
        <TouchableOpacity onPress={onPress}>
            <View style={[styles.container, style]}>
                <DText style={styles.text}>{label}</DText>
            </View>
        </TouchableOpacity>
    );
};

const styles = StyleSheet.create({
    container: {
        display: "flex",
        alignItems: "center",
        justifyContent: "center",
        alignContent: "center",
        backgroundColor: '#2478F8',
        borderRadius: responsiveWidth(1),
        padding: responsiveWidth(2),
    },
    text: {
        color: "white",
        fontSize: RFPercentage(2),
        textAlignVertical: "center",
    }
});

export default BasicButton;