import { Query } from 'react-apollo'
import Gallery from './Gallery'
import Port from './Port'
import Connection from './Connection'
import InterfaceOption from './InterfaceOption'
import { INTERFACES } from './InterfaceList'
const InterfaceFormFields = props => {
const { state, onChange } = props
const toState = event => {
let interfaces = state
const ifaceSelected = event.target.checked
const index = state.findIndex(iface => iface === event.target.value)
if (ifaceSelected && index < 0) {
interfaces = [...state, event.target.value]
}
if (!ifaceSelected && index >= 0) {
interfaces = [...state.slice(0, index), ...state.slice(index + 1)]
}
onChange(interfaces)
}
return (
Loading interfaces Error loading interfaces: {error.message} No interfaces found
Script:
{workerScript.path}