import {useNavigation} from '@react-navigation/native';
import React from 'react';
import {StyleSheet, TouchableOpacity, View, ViewProps} from 'react-native';
import LinearGradient from 'react-native-linear-gradient';
import {TAGGS_GRADIENT} from '../../constants';

interface TaggProps extends ViewProps {}

const Tagg: React.FC<TaggProps> = ({style}) => {
  const navigation = useNavigation();

  return (
    <TouchableOpacity
      onPress={() =>
        navigation.navigate('SocialMediaTaggs', {
          socialMediaType: 'Instagram',
        })
      }>
      <LinearGradient
        colors={[TAGGS_GRADIENT.start, TAGGS_GRADIENT.end]}
        useAngle={true}
        angle={154.72}
        angleCenter={{x: 0.5, y: 0.5}}
        style={[styles.gradient, style]}>
        <View style={styles.image} />
      </LinearGradient>
    </TouchableOpacity>
  );
};

const styles = StyleSheet.create({
  gradient: {
    width: 80,
    height: 80,
    borderRadius: 40,
    justifyContent: 'center',
    alignItems: 'center',
  },
  image: {
    width: 72,
    height: 72,
    borderRadius: 37.5,
    backgroundColor: 'pink',
  },
});

export default Tagg;
