import React, { FC, memo } from 'react'; import Modal from './Modal'; import TreeIcon from './icons/TreeIcon'; import Button from './core/Button'; import useNodeLicense from '../hooks/useNodeLicense'; import { NODE_LIMIT } from '../configs'; import useNodeLicenseOperation from '../hooks/useNodeLicenseOperation'; import { Loading } from './Loading'; import { useNavigate } from 'react-router'; const NodesModal: FC<{ open: boolean; onClose: () => void }> = ({ open, onClose, }) => { const push = useNavigate(); const { data } = useNodeLicense(); const { data: license, toggleMutation } = useNodeLicenseOperation(); return (

By clicking{' '} Turn On All Nodes{' '} you’ll be able to begin the operation of all your Myria Node license/s. your Node license will continue to operate indefinitely (even if the tab, browser closes or device is shutdown). The only action that will switch off your node operation would be to interact with the node operation button on myria.com to Turn Off All Nodes.

{license.all_nodes_running ? (
{ onClose(); push('/nodes/dashboard'); }} >

<>VIEW DASHBOARD

) : (
{toggleMutation.isLoading ? (
) : (
toggleMutation.mutate(true)} >

TURN ON ALL NODES

)}
)}
{data?.map((node) => (
{node.nodeId}
))}
{data?.length < NODE_LIMIT && (

Maximise your network?

)}
); }; export default memo(NodesModal);