import { FC, Fragment, createElement as h } from 'react'; import { Helmet } from 'react-helmet-async'; import { PageProps } from '@not-govuk/app-composer'; import { NavigationMenu } from '@not-govuk/components'; import { DocsPage } from '@not-govuk/docs-components'; import { useLocation } from '@not-govuk/router'; import { componentLinks, nameParam, components as subpages } from '../stories'; import config from '../config'; const siteTitle = config.title; export const title = 'Components'; const description = `The components provided in ${siteTitle}`; const Page: FC = () => { const location = useLocation(); const subPageName = location.query[nameParam] as unknown as string; const stories = subpages[subPageName]; return (
{title} - {siteTitle}
{ stories ? ( {title} ) : ( subPageName ? ( null // should be a 404! ) : (

{title}

Components are reusable parts of the user interface that have been made to support a variety of applications.

) ) }
); }; export default Page;