import React from 'react';
import {Image} from 'react-native';

interface SocialIconProps {
  social: string;
  style: object;
}
/**
 * An image component that returns the <Image> of the icon for a specific social media platform.
 */
const SocialIcon: React.FC<SocialIconProps> = ({
  social: social,
  style: style,
}) => {
  switch (social) {
    case 'Instagram':
      var icon = require('../../assets/images/instagram-icon.png');
      break;
    case 'Facebook':
      var icon = require('../../assets/images/facebook-icon.png');
      break;
    case 'Twitter':
      var icon = require('../../assets/images/twitter-icon.png');
      break;
    case 'Twitch':
      var icon = require('../../assets/images/twitch-icon.png');
      break;
    case 'Pinterest':
      var icon = require('../../assets/images/pinterest-icon.png');
      break;
    case 'Whatsapp':
      var icon = require('../../assets/images/whatsapp-icon.png');
      break;
    case 'Linkedin':
      var icon = require('../../assets/images/linkedin-icon.png');
      break;
    case 'Snapchat':
      var icon = require('../../assets/images/snapchat-icon.png');
      break;
    case 'Youtube':
      var icon = require('../../assets/images/youtube-icon.png');
      break;
    case 'TikTok':
      var icon = require('../../assets/images/tiktok-icon.png');
      break;
    default:
      var icon = require('../../assets/images/logo.png');
      break;
  }
  return <Image style={style} source={icon} />;
};

export default SocialIcon;
