*/}
- {
- onStateChangeRequest(thing)
- }}
- sx={{
- borderRadius: '50%',
- width: 50,
- height: 50,
- zIndex: 1,
- }}
- >
- {getThingIcon(thing?.type)}
-
+
+ {
+ handleRequestChange(thing)
+ }}
+ sx={{
+ borderRadius: '50%',
+ width: 50,
+ minWidth: 50,
+ height: 50,
+ zIndex: 1,
+ }}
+ disabled={isDisabled}
+ >
+ {getThingIcon(thing?.type)}
+
+ {isDisabled && (
+
+ )}
+
{
const [isShowCreateThingModal, setIsShowCreateThingModal] = useState(false)
const [createModalThing, setCreateModalThing] = useState(null)
const [confirmModelConfig, setConfirmModelConfig] = useState({})
+
+ const [isSnackbarOpen, setIsSnackbarOpen] = useState(false)
+ const [snackBarMessage, setSnackBarMessage] = useState('')
+
useEffect(() => {
// fetch things
GetThings().then(result => {
@@ -184,6 +222,8 @@ const ThingsView = () => {
}
})
})
+ setSnackBarMessage('Thing saved successfully')
+ setIsSnackbarOpen(true)
}
const handleEditClick = thing => {
setCreateModalThing(thing)
@@ -240,6 +280,8 @@ const ThingsView = () => {
})
})
}
+ setSnackBarMessage('Thing state updated successfully')
+ setIsSnackbarOpen(true)
}
return (
@@ -317,6 +359,19 @@ const ThingsView = () => {
)}