import React from 'react';
import {SafeAreaView, ScrollView, View} from 'react-native';
import styles from '../style';

import WishListComponent from '../components/WishListComponent';
import BirthdayModal from '../modals/BirthdayModals';
import CalendarBirthday from './subViews/CalendarBirthday';
import Quotation from './subViews/QuotationList';
const HomeMainView = ({
  userInfo,
  openView,
  openModalHappyBirthday,
  closeModalHappyBirthday,
  wishList,
  openProfileComponent,
  openCheckIn,
  chooseSetting,
  chooseSettingView,
  openSettingView,
  calendarBirthdayProps,
  randomQuotation,
  birthdayModalProps,
}) => {
  return (
    <SafeAreaView style={styles.container}>
      {!openCheckIn && (
        <ScrollView
          style={{
            backgroundColor: openProfileComponent ? 'grey' : null,
          }}
          nestedScrollEnabled={true}
          showsVerticalScrollIndicator={false}>
          <View>
            {/* <View
              style={{
                position: 'absolute',
                top: 10,
                right: 5,
                zIndex: 100,
              }}>
              <ButtonComponent
                style={{position: 'absolute', top: 10, right: 10}}
                iconSource={IMAGES.IcMore}
                styleIcon={{width: 20, height: 20}}
                onPress={openSettingView}
              />
              {chooseSetting?.isVisible && (
                <ButtonComponent
                  style={{
                    backgroundColor: 'white',
                    padding: 10,
                    position: 'absolute',
                    top: 30,
                    right: 10,
                  }}
                  text={chooseSetting?.title}
                  onPress={chooseSettingView}
                />
              )}
            </View> */}
            <Quotation quotation={randomQuotation} />
          </View>
          {/*Calendar*/}
          <CalendarBirthday {...calendarBirthdayProps} />
          {/*wish */}
          {wishList.length > 0 && (
            <WishListComponent
              userDetails={userInfo}
              openView={openView}
              openModalHappyBirthday={openModalHappyBirthday}
              closeModalHappyBirthday={closeModalHappyBirthday}
              dataBirthday={wishList}
            />
          )}
        </ScrollView>
      )}
      <BirthdayModal {...birthdayModalProps} />
      {openProfileComponent && openProfileComponent}
    </SafeAreaView>
  );
};

export default HomeMainView;
