InstrumentSubsystem.js 992 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import gql from 'graphql-tag'
  2. import { Query, Mutation } from 'react-apollo'
  3. import Gallery from './Gallery'
  4. const CREATE_INSTRUMENT_SUBSYSTEM = gql`
  5. mutation CREATE_INSTRUMENT_SUBSYSTEM($name: String!, $description: String!, $interfaces: [String]!) {
  6. createInstrument(name: $name, description: $description, interfaces: $interfaces) {
  7. id
  8. }
  9. }
  10. `
  11. class InstrumentSubsystem extends React.Component {
  12. state = {
  13. id: null,
  14. name: '',
  15. description: '',
  16. commands: [],
  17. parameters: [],
  18. subsystems: [],
  19. ...this.props.instrumentSubsystem
  20. }
  21. toState = event => {
  22. this.setState({ [event.target.name]: event.target.value })
  23. }
  24. render() {
  25. return (
  26. <div>
  27. <h1>{this.state.name}</h1>
  28. <p>{this.state.description}</p>
  29. <Gallery title='Commands' items={[]} />
  30. <Gallery title='Parameters' items={[]} />
  31. <Gallery title='Subsystems' items={[]} />
  32. </div>
  33. )
  34. }
  35. }
  36. export default InstrumentSubsystem