|
|
|
|
@ -14,14 +14,6 @@ import {
@@ -14,14 +14,6 @@ import {
|
|
|
|
|
} from "grommet"; |
|
|
|
|
import { Close, Trash } from "grommet-icons"; |
|
|
|
|
|
|
|
|
|
const CONNECT_DEVICE = gql` |
|
|
|
|
mutation connectDevice($id: String!) { |
|
|
|
|
connectDevice(id: $id) { |
|
|
|
|
id |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
const MSGS_FRAGMENT = gql` |
|
|
|
|
fragment DeviceMsgs on Device { |
|
|
|
|
messages |
|
|
|
|
@ -30,9 +22,6 @@ const MSGS_FRAGMENT = gql`
@@ -30,9 +22,6 @@ const MSGS_FRAGMENT = gql`
|
|
|
|
|
|
|
|
|
|
const Device = ({ device, messages, onMessagesClosed }) => { |
|
|
|
|
const client = useApolloClient(); |
|
|
|
|
const [connect] = useMutation(CONNECT_DEVICE, { |
|
|
|
|
variables: { id: device.id }, |
|
|
|
|
}); |
|
|
|
|
const [groups, setGroups] = useState([]); |
|
|
|
|
const [selectedTabs, setSelectedTabs] = useState({}); |
|
|
|
|
const [currentTab, setCurrentTab] = useState(0); |
|
|
|
|
@ -49,14 +38,6 @@ const Device = ({ device, messages, onMessagesClosed }) => {
@@ -49,14 +38,6 @@ const Device = ({ device, messages, onMessagesClosed }) => {
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<Box> |
|
|
|
|
{!device.connected && ( |
|
|
|
|
<Button |
|
|
|
|
label="Connect" |
|
|
|
|
onClick={() => { |
|
|
|
|
connect(); |
|
|
|
|
}} |
|
|
|
|
/> |
|
|
|
|
)} |
|
|
|
|
<Tabs |
|
|
|
|
justify="start" |
|
|
|
|
activeIndex={currentTab} |
|
|
|
|
|