Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x 1x | import React from "react";
import { EmailIcon, MapPinIcon, PhoneIcon } from "../icons";
type ExternalLinkProps = {
type: "email" | "phone" | "location";
value: string;
};
const ExternalLink: React.FC<ExternalLinkProps> = ({ type, value }) => {
const hrefPrefix = {
email: "mailto:",
phone: "tel:",
location: "https://maps.google.com/?q="}[type];
const Icon = {
email: EmailIcon,
phone: PhoneIcon,
location: MapPinIcon}[type];
return (
<li>
<a href={`${hrefPrefix}${value}`} target="_blank" rel="noopener noreferrer" className="flex items-center gap-4.5 text-dark-3 dark:text-gray-300 hover:text-blue dark:hover:text-blue">
<Icon />
{value}
</a>
</li>
);
};
export default ExternalLink;
|