import React, { useEffect, useState } from 'react';
import type {Node} from 'react';
import {
Text,
TextInput,
View,
Button,
} from 'react-native';
const state = {
"loginScreen": 0,
"statusFetch": 1,
"waiting": 2,
"waking": 3,
"fullyAwake": 4,
"default": 0,
}
const StatusFetch = () =>
Fetching subscriber status
const Waiting = (activeCount, totalCount, wakeup) =>
{activeCount} / {totalCount} Miners are active
const Waking = () =>
Waking up subscribers
const FullyAwake = (totalCount) =>
All {totalCount} Miners are active
const StatusView = ({username, appStatus, activeCount, totalCount, wakeup}) => {
const content = () => {
if (appStatus == state.statusFetch)
return StatusFetch();
if (appStatus == state.waiting)
return Waiting(activeCount, totalCount, wakeup);
if (appStatus == state.waking)
return Waking();
if (appStatus == state.fullyAwake)
return FullyAwake(totalCount);
return null;
}
return (
User: {username}
{content()}
)
}
export default StatusView;
export {
state as appState
};