import * as React from 'react'; import '@fortawesome/fontawesome-svg-core'; import { faEnvelope } from '@fortawesome/free-solid-svg-icons'; import { faTelegram, faTwitter, faGithub, faLinkedin, faTwitch, faTelegramPlane } from '@fortawesome/free-brands-svg-icons'; import { IconDefinition, IconName, IconPrefix } from '@fortawesome/fontawesome-svg-core'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { Contact, contactToLink, ContactType } from '../../../src/contacts/contacts'; type Props = { contacts: Contact[]; }; const typeToIcon: { [key in ContactType]: [IconDefinition, string?] } = { tg: [faTelegramPlane], mail: [faEnvelope], twitter: [faTwitter], github: [faGithub], linkedin: [faLinkedin], twitch: [faTwitch] }; const ContactComp = ({ id, type }: Contact) => { const iconDescr = typeToIcon[type]; return (
); }; export default ({ contacts }: Props) => (
{contacts.map((c) => ContactComp(c))}
);