Reactive-Resume/client/utils/getProfileIcon.tsx

45 lines
1.0 KiB
TypeScript
Raw Normal View History

2022-03-02 16:44:11 +00:00
import { Link } from '@mui/icons-material';
import get from 'lodash/get';
import {
FaBehance,
FaDribbble,
FaFacebookF,
FaGithub,
FaGitlab,
2022-04-30 10:58:17 +00:00
FaHackerrank,
2022-03-02 16:44:11 +00:00
FaInstagram,
FaLinkedinIn,
FaSkype,
FaSoundcloud,
FaStackOverflow,
FaTelegram,
FaTwitter,
FaXing,
2022-03-02 16:44:11 +00:00
FaYoutube,
} from 'react-icons/fa';
2022-04-30 10:58:17 +00:00
import { SiCodechef, SiCodeforces } from 'react-icons/si';
2022-03-02 16:44:11 +00:00
const profileIconMap: Record<string, JSX.Element> = {
2022-04-30 10:58:17 +00:00
behance: <FaBehance />,
codechef: <SiCodechef />,
codeforces: <SiCodeforces />,
2022-03-02 16:44:11 +00:00
dribbble: <FaDribbble />,
2022-04-30 10:58:17 +00:00
facebook: <FaFacebookF />,
2022-03-02 16:44:11 +00:00
github: <FaGithub />,
2022-04-30 10:58:17 +00:00
gitlab: <FaGitlab />,
hackerrank: <FaHackerrank />,
2022-03-02 16:44:11 +00:00
instagram: <FaInstagram />,
2022-04-30 10:58:17 +00:00
linkedin: <FaLinkedinIn />,
skype: <FaSkype />,
soundcloud: <FaSoundcloud />,
2022-03-02 16:44:11 +00:00
stackoverflow: <FaStackOverflow />,
telegram: <FaTelegram />,
2022-04-30 10:58:17 +00:00
twitter: <FaTwitter />,
xing: <FaXing />,
2022-03-02 16:44:11 +00:00
youtube: <FaYoutube />,
};
const getProfileIcon = (network: string): JSX.Element => get(profileIconMap, network.toLowerCase(), <Link />);
export default getProfileIcon;