You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
658 B
26 lines
658 B
4 years ago
|
import Panel from '../Panel';
|
||
|
import Text from '../Text/HeaderText';
|
||
4 years ago
|
import AnvilNode from './AnvilNode';
|
||
4 years ago
|
import PeriodicFetch from '../../lib/fetchers/periodicFetch';
|
||
4 years ago
|
|
||
|
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 */
|
||
4 years ago
|
|
||
|
return (
|
||
|
<Panel>
|
||
|
<Text text="Nodes" />
|
||
4 years ago
|
<AnvilNode
|
||
4 years ago
|
node={anvil?.nodes.map((n, index) => {
|
||
|
return { ...n, ...data?.nodes[index] };
|
||
4 years ago
|
})}
|
||
|
/>
|
||
4 years ago
|
</Panel>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default Nodes;
|