// @flow import React from 'react'; import { observer } from 'mobx-react'; import _ from 'lodash'; import { Flex } from 'reflexbox'; import SearchField from './components/SearchField'; import styles from './Search.scss'; import SearchStore from './SearchStore'; import Layout, { Title } from 'components/Layout'; import CenteredContent from 'components/CenteredContent'; import DocumentPreview from 'components/DocumentPreview'; type Props = { route: Object, routeParams: Object, }; @observer class Search extends React.Component { props: Props; store: SearchStore; constructor(props: Props) { super(props); this.store = new SearchStore(); } componentDidMount = () => { const { splat } = this.props.routeParams; if (this.viewNotFound) { let searchTerm = _.last(splat.split('/')); searchTerm = searchTerm.split(/[\s-]+/gi).join(' '); this.store.search(searchTerm); } }; get viewNotFound(): boolean { const { sceneType } = this.props.route; return sceneType === 'notFound'; } render() { const search = _.debounce(searchTerm => { this.store.search(searchTerm); }, 250); const title =
We're unable to find the page you're accessing.