From 462b2fe10cf45da3dbcb5ee20ca6dfb79f46e6b6 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Thu, 4 Nov 2021 13:34:02 +0200 Subject: Initial commit --- components/Social/Social.tsx | 45 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 components/Social/Social.tsx (limited to 'components/Social/Social.tsx') diff --git a/components/Social/Social.tsx b/components/Social/Social.tsx new file mode 100644 index 0000000..f663f6e --- /dev/null +++ b/components/Social/Social.tsx @@ -0,0 +1,45 @@ +import styles from "./Social.module.css"; + +export type SocialType = "telegram" | "linkedin" | "github"; + +interface Props { + type: SocialType; +} + +interface TypeItem { + alt: string; + src: string; + href: string; +} + +const typeMap: Record = { + telegram: { + alt: "Telegram", + src: "/social/telegram.svg", + href: "https://t.me/kal_jan", + }, + linkedin: { + alt: "LinkedIn", + src: "/social/linkedin.svg", + href: "https://www.linkedin.com/in/jantuomi/", + }, + github: { + alt: "GitHub", + src: "/social/github.svg", + href: "http://github.com/jantuomi" + }, +}; + +const Social = ({ type }: Props): JSX.Element => { + const typeItem = typeMap[type]; + + return ( + + {typeItem.alt} + + ); +}; + + + +export default Social; -- cgit v1.3