import React, { ReactNode } from 'react' import { usePersonContext } from '../hooks/PersonContext' import Container from 'react-bootstrap/esm/Container' import { useAutoFocus } from '../hooks/FocusedElement' import { Col, Row } from 'react-bootstrap' export function Contact(props: {icon?: string, text: string}) { let textElement: ReactNode = {props.text} if (props.text.match(/^(www|http)/)) { let text = props.text let url = text const urlMatch = text.match(/^https?:\/\/(.+)\/?$/) if (urlMatch) { text = urlMatch[1] } else { url = `https://${props.text}` } textElement = {text} } if (props.text.match(/.+@.+\..+/)) { const url = `mailto:${props.text}` textElement = {props.text} } return (