import { VscGithub } from "react-icons/vsc";
import { BsGlobe2, BsFileEarmarkMedical } from "react-icons/bs";
import styles from "./projects.module.scss";

interface IProjectLinksProps {
	github?: string;
	access?: string;
	document?: string;
}

const ProjectLinks = (props: IProjectLinksProps): JSX.Element => {
	const { github, access, document } = props;

	const handleClick = (e: React.MouseEvent): void => {
		e.stopPropagation();
	};

	return (
		<div className={styles.links} onClick={handleClick}>
			{github && (
				<a
					href={github}
					title={"Github repository of the project"}
					className={styles.icon}
					target={"_blank"}
					rel={"noopener noreferrer"}
				>
					<VscGithub/>
				</a>
			)}
			{access && (
				<a
					href={access}
					title={"View and use the project here"}
					className={styles.icon}
					target={"_blank"}
					rel={"noopener noreferrer"}
				>
					<BsGlobe2/>
				</a>
			)}
			{document && (
				<a
					href={document}
					title={"The report here"}
					className={styles.icon}
					target={"_blank"}
					rel={"noopener noreferrer"}
				>
					<BsFileEarmarkMedical/>
				</a>
			)}
		</div>
	);
};

export default ProjectLinks;
