refactor: modify Nodes to fetch and display real data

main
Josue 4 years ago committed by Tsu-ba-me
parent fef1bac9c6
commit ec8b171bea
  1. 14
      striker-ui/components/Nodes.tsx

@ -1,12 +1,20 @@
import InnerPanel from './InnerPanel';
import Panel from './Panel';
import Text from './Text/HeaderText';
import AnvilNode from './AnvilNode';
import PeriodicFetch from '../lib/fetchers/periodicFetch';
const Nodes = ({ anvil }: { anvil: AnvilListItem }): JSX.Element => {
const { data } = PeriodicFetch<AnvilStatus>(
`${process.env.NEXT_PUBLIC_API_URL}/anvils/get_status?anvil_uuid=`,
anvil?.anvil_uuid,
);
/* eslint-disable no-param-reassign */
if (anvil) anvil.anvil_status = data;
const Nodes = (): JSX.Element => {
return (
<Panel>
<Text text="Nodes" />
<InnerPanel />
<AnvilNode node={anvil?.anvil_status} />
</Panel>
);
};

Loading…
Cancel
Save