import {FC} from "react";
import {StyleSheet, View} from "react-native";
import {BottomSheetModalProvider} from "@gorhom/bottom-sheet";
import {useSelector} from "react-redux";
import {RootState} from "../../../redux/store";
import Modal from "react-native-modal";
import {background, blue} from "../../../css/colors";
import {responsiveHeight, responsiveWidth} from "react-native-responsive-dimensions";
import * as Progress from 'react-native-progress';
import DTitle from "../../DTitle/DTitle";
import {RFPercentage} from "react-native-responsive-fontsize";
import BasicButton from "../../BasicButton/BasicButton";

type Props = {
    visible: boolean;
    text: string;
    onAccepted: () => void;
    onRefused: () => void;
}
const AcceptModal: FC<Props> = ({visible, text, onAccepted, onRefused}) => {

    return (
        <Modal isVisible={visible}>
            <View style={styles.container}>
                <DTitle style={{textAlign: "center"}}>{text}</DTitle>
                <View style={styles.buttonsWrapper}>
                    <BasicButton style={[styles.button, styles.acceptButton]} label={"Да"}
                                 onPress={() => onAccepted()}/>
                    <BasicButton style={[styles.button, styles.refuseButton]} label={"Нет"}
                                 onPress={() => onRefused()}/>
                </View>

            </View>
        </Modal>
    )
}

const styles = StyleSheet.create({
    container: {
        alignSelf: "center",
        backgroundColor: background,
        width: responsiveWidth(80),
        height: responsiveHeight(50),
        borderRadius: responsiveWidth(2),
        paddingHorizontal: responsiveWidth(15),
        paddingVertical: responsiveHeight(10),
        justifyContent: "center",
        rowGap: responsiveHeight(5)
    },
    buttonsWrapper: {
        flexDirection: "row",
        justifyContent: "space-between",
    },
    progressBar: {
        justifyContent: "center"
    },
    button: {
        paddingHorizontal: responsiveWidth(8)
    },
    acceptButton: {},
    refuseButton: {
        backgroundColor: "red"
    },
})
export default AcceptModal;