import { StyleSheet, } from 'react-native'
import React, { useContext } from 'react'
import IonIcon from 'react-native-vector-icons/Ionicons'
import colors from '../../../constants/colors'
import ButtonWrapper from './ButtonWrapper'
import { moderateScale } from '../../../constants/metrics'
import { ThemeContext } from '../../../context/theme.context'
import FontAwesomeIcon from 'react-native-vector-icons/FontAwesome5'
const ShareButton = ({ size, buttonStyle, iconColor, iconSize, onPress }) => {

  const theme = useContext(ThemeContext)
  const currentTheme = theme.state.theme

  const styles = StyleSheet.create({
    buttonStyle: {
      alignItems: 'center',
      justifyContent: 'center',
      height: 'auto',
      width: 'auto'
    },
    icon: {
      color: colors().primaryColor,
      fontSize: moderateScale(18)
    }
  
  })

  return (
    <ButtonWrapper onPress={onPress} buttonStyle={buttonStyle}>
      <FontAwesomeIcon name='share-alt' color={iconColor ? iconColor :currentTheme === 'light' ? colors().grayShade_400 : colors().white} size={iconSize ? iconSize : styles.icon.fontSize} />
    </ButtonWrapper>
  )
}

export default ShareButton

