import Button from '@/components/Button';
import { InformationContext } from '@/contexts/InformationContext';
import { InformationContext2 } from '@/contexts/InformationContext2';
import { getIconPath } from '@/constants/constants';
import React, { useContext } from 'react';
import { View, Modal, Image, Dimensions } from 'react-native';
import AppText from '../AppText';
import fonts from '@/styles/fonts';

interface PopupProps {
  isVisible: boolean;
  isPopUpone: boolean;
  onClose: () => void;
}

const InfoPopUp: React.FC<PopupProps> = ({ isVisible, isPopUpone, onClose }) => {
  const screenHeight = Dimensions.get('window').height;
  const popupHeight = screenHeight * 0.8;

  return (
    <Modal visible={isVisible} transparent>
      <View
        style={{
          flex: 1,
          justifyContent: 'center',
          alignItems: 'center',
          backgroundColor: 'rgba(0, 0, 0, 0.5)',
        }}
      >
        <View
          style={{
            height: popupHeight,
            width: '80%',
            backgroundColor: 'white',
            borderRadius: 10,
            padding: 16,
            justifyContent: 'center',
            alignItems: 'center',
          }}
        >
            <Image
                  source={require('@/assets/images/info.png')}
                  style={{
                    width: '100%',
                    height: '80%',
                    resizeMode: 'contain',
                    marginTop: 10,
                  }}
                />

          <Button text={'FERMER'} isSelected onPress={onClose} />
        </View>
      </View>
    </Modal>
  );
};

export default InfoPopUp;
