import React, { StatelessComponent } from 'react'; import SEO from './SEO'; import parseHTML from '../utils/parseHTML'; interface DocsPageProps { title: string; html: string; relPath: string; branch: string; gitURL: string; }; const DocsPage: StatelessComponent = ({ title, html, branch, relPath, gitURL }): ReactElement => { const editLink = `${gitURL.replace(/\.git$/, '')}/edit/${branch}/${relPath}`; return ( <> {parseHTML(html)} {editLink &&
{` `} Edit on Github
} ); }; export default DocsPage;