c66d7ed489
* Use new eslint rules and apply fixes. Use new logo component and shared theme + webpack config. * Add shared component to display a copy icon and copy to clipboard with confirmation state * Organise imports * Add copy mixnode identity key to list of mixnodes and detail view * Update nvm node version to 16 * Update GitHub Actions for Network Explorer to use yarn and yarn workspaces * Switch favicon for smaller N icon * Update README * Add error boundary
29 lines
849 B
TypeScript
29 lines
849 B
TypeScript
import CheckCircleOutlineIcon from '@mui/icons-material/CheckCircleOutline';
|
|
import PauseCircleOutlineIcon from '@mui/icons-material/PauseCircleOutline';
|
|
import CircleOutlinedIcon from '@mui/icons-material/CircleOutlined';
|
|
import { MixnodeStatus } from '../typeDefs/explorer-api';
|
|
|
|
export const Icons = {
|
|
Mixnodes: {
|
|
Status: {
|
|
Active: CheckCircleOutlineIcon,
|
|
Standby: PauseCircleOutlineIcon,
|
|
Inactive: CircleOutlinedIcon,
|
|
},
|
|
},
|
|
};
|
|
|
|
export const getMixNodeIcon = (value: any) => {
|
|
if (value && typeof value === 'string') {
|
|
switch (value) {
|
|
case MixnodeStatus.active:
|
|
return Icons.Mixnodes.Status.Active;
|
|
case MixnodeStatus.standby:
|
|
return Icons.Mixnodes.Status.Standby;
|
|
default:
|
|
return Icons.Mixnodes.Status.Inactive;
|
|
}
|
|
}
|
|
return Icons.Mixnodes.Status.Inactive;
|
|
};
|