import React, { PropTypes } from 'react'; import withStyles from 'isomorphic-style-loader/lib/withStyles'; import s from './Admin.css'; import Link from '../../components/Link'; import Button from '../../components/Button'; class Admin extends React.Component { static propTypes = { title: PropTypes.string.isRequired, people: PropTypes.arrayOf(PropTypes.shape({ key: PropTypes.string.isRequired, firstname: PropTypes.string, lastname: PropTypes.string, email: PropTypes.string, password: PropTypes.string, attending: PropTypes.boolean, })).isRequired, starters: PropTypes.arrayOf(PropTypes.shape({ name: PropTypes.string, total: PropTypes.integer, })).isRequired, mains: PropTypes.arrayOf(PropTypes.shape({ name: PropTypes.string, total: PropTypes.integer, })).isRequired, build: PropTypes.shape({ hash: PropTypes.string, time: PropTypes.string, }), settings: PropTypes.shape({ slack: PropTypes.boolean, email: PropTypes.boolean, }), }; render() { return (

{this.props.title}

People

{this.props.people.length} people

{this.props.people.filter(person => person.completed).length} responses

Manage people

Food

Starters

    {this.props.starters.map((starter, index) => (
  • {starter.name} - {starter.total}
  • ))}

Mains

    {this.props.mains.map((main, index) => (
  • {main.name} - {main.total}
  • ))}

Settings

Build hash: {this.props.build.hash}
Build time: {this.props.build.time}
); } } export default withStyles(s)(Admin);