import { Store } from 'pullstate'
import { LinearProgress } from '../LinearProgress'

export const NetworkStore = new Store({
  loading: false,
})

export default function GlobalNetworkLoadingIndicator() {
  const { loading } = NetworkStore.useState()

  if (loading) return <LinearProgress />
  if (loading) return null
}
