InstrumentCommand.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. import gql from 'graphql-tag'
  2. import { Query, Mutation } from 'react-apollo'
  3. const InstrumentCommandFormFields = props => {
  4. const { state, onChange } = props
  5. return (
  6. <fieldset>
  7. <label htmlFor='name'>Name</label>
  8. <input type='text' name='name' id='name' placeholder='Name' value={state.name} onChange={onChange} />
  9. <label htmlFor='description'>Name</label>
  10. <textarea name='description' id='description' placeholder='Description' value={state.description} onChange={onChange} />
  11. </fieldset>
  12. )
  13. }
  14. const InstrumentCommand = props => {
  15. const { command } = props
  16. const state = {
  17. id: null,
  18. tag: '',
  19. name: '',
  20. description: '',
  21. instrument: null,
  22. readString: '',
  23. writeString: '',
  24. parameters: []
  25. }
  26. return (
  27. <div>
  28. <h1>{command.name}</h1>
  29. <p>{command.description}</p>
  30. <p>Tag: {command.tag}</p>
  31. <pre>{command.readString}</pre>
  32. <pre>{command.writeString}</pre>
  33. <div>Here go the parameters</div>
  34. </div>
  35. )
  36. }
  37. export default InstrumentCommand
  38. export { InstrumentCommandFormFields }