From e775b4ac16f068b8d8024471521807c477c28982 Mon Sep 17 00:00:00 2001 From: Josue Date: Tue, 25 May 2021 14:40:30 -0400 Subject: [PATCH] refactor: use regex instead of a map to display node state --- striker-ui/components/Nodes/AnvilNode.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/striker-ui/components/Nodes/AnvilNode.tsx b/striker-ui/components/Nodes/AnvilNode.tsx index 99a43108..4369b675 100644 --- a/striker-ui/components/Nodes/AnvilNode.tsx +++ b/striker-ui/components/Nodes/AnvilNode.tsx @@ -3,7 +3,6 @@ import { makeStyles } from '@material-ui/core/styles'; import { InnerPanel, PanelHeader } from '../Panels'; import { ProgressBar } from '../Bars'; import { BodyText } from '../Text'; -import nodeState from '../../lib/consts/NODES'; import Decorator, { Colours } from '../Decorator'; import putJSON from '../../lib/fetchers/putJSON'; @@ -59,6 +58,8 @@ const AnvilNode = ({ nodes: Array; }): JSX.Element => { const classes = useStyles(); + const regex = /(^|| )+[a-zA-Z0-9]/; + return ( {nodes && @@ -76,7 +77,10 @@ const AnvilNode = ({ c.toUpperCase()) || + 'Not Available' + } />