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/socials/instagram-icon.png');
      break;
    case 'Facebook':
      var icon = require('../../assets/socials/facebook-icon.png');
      break;
    case 'Twitter':
      var icon = require('../../assets/socials/twitter-icon.png');
      break;
    case 'Twitch':
      var icon = require('../../assets/socials/twitch-icon.png');
      break;
    case 'Pinterest':
      var icon = require('../../assets/socials/pinterest-icon.png');
      break;
    case 'Whatsapp':
      var icon = require('../../assets/socials/whatsapp-icon.png');
      break;
    case 'Linkedin':
      var icon = require('../../assets/socials/linkedin-icon.png');
      break;
    case 'Snapchat':
      var icon = require('../../assets/socials/snapchat-icon.png');
      break;
    case 'Youtube':
      var icon = require('../../assets/socials/youtube-icon.png');
      break;
    case 'TikTok':
      var icon = require('../../assets/socials/tiktok-icon.png');
      break;
    default:
      var icon = require('../../assets/socials/logo.png');
      break;
  }
  return <Image style={style} source={icon} />;
};

export default SocialIcon;
