require('./notificationLookup.less'); const React = require('react'); const createClass = require('create-react-class'); const cx = require('classnames'); const request = require('superagent'); const Moment = require('moment'); const NotificationLookup = createClass({ getDefaultProps() { return {}; }, getInitialState() { return { query : '', foundNotification : null, searching : false, error : null }; }, handleChange(e){ this.setState({ query: e.target.value }); }, lookup(){ this.setState({ searching: true, error: null }); request.get(`/admin/notification/lookup/${this.state.query}`) .then((res)=>this.setState({ foundNotification: res.body })) .catch((err)=>this.setState({ error: err })) .finally(()=>this.setState({ searching: false })); }, renderFoundNotification(){ const notification = this.state.foundnotification; return