import * as React from 'react' ; import Link from 'gatsby-link' ; interface Props { href : string ; [ key ] : any ; } export default function A ( { href , children , ... rest } ) { if ( href && typeof href . startsWith === 'function' && ! href . startsWith ( 'http' ) ) { return < Link to = { href } { ... rest } > { children } < /Link>; } return < a href = { href } { ... rest } target = "_blank" > { children } < /a>; }