xcv58/Custom-JavaScript-for-Websites-2

View on GitHub
src/js/components/AutoSave.tsx

Summary

Maintainability
A
0 mins
Test Coverage
import React from 'react'
import { CircularProgress, InputLabel } from '@material-ui/core'
import { useStore } from './StoreContext'
import { observer } from 'mobx-react'

export default observer(() => {
  const { saved, autoSaveHandle } = useStore().AppStore
  const content =
    (autoSaveHandle && <CircularProgress size={24} />) ||
    (saved && (
      <InputLabel>Draft saved. Click "Save" to apply the script.</InputLabel>
    ))
  return <span>{content}</span>
})