From 08b0ce9817060d9cb1c31ebfdc568fc6ac568039 Mon Sep 17 00:00:00 2001 From: Bonjour Internet Date: Wed, 11 Oct 2023 21:52:13 +0200 Subject: [PATCH 1/6] ref: StatusLabel --- src/components/common/StatusLabel/cmp.tsx | 39 ++----------------- src/components/common/StatusLabel/types.ts | 6 +-- .../dashboard/manage/ManageDomain/cmp.tsx | 6 ++- .../dashboard/manage/ManageInstance/cmp.tsx | 17 ++++++-- 4 files changed, 21 insertions(+), 47 deletions(-) diff --git a/src/components/common/StatusLabel/cmp.tsx b/src/components/common/StatusLabel/cmp.tsx index 2a6e704c..ec27b279 100644 --- a/src/components/common/StatusLabel/cmp.tsx +++ b/src/components/common/StatusLabel/cmp.tsx @@ -1,48 +1,15 @@ import React, { useMemo } from 'react' import { StatusLabelProps } from './types' import Label from '../Label/cmp' -import { LabelVariant } from '../Label/types' -import { RotatingLines } from 'react-loader-spinner' -import { Icon } from '@aleph-front/aleph-core' import { useTheme } from 'styled-components' export const StatusLabel = React.memo( - ({ variant, ...rest }: StatusLabelProps) => { + ({ variant, children, ...rest }: StatusLabelProps) => { const theme = useTheme() - const labelVariant: LabelVariant = useMemo( - () => - variant === 'running' || variant === 'ready' - ? 'success' - : variant === 'confirming' - ? 'warning' - : 'error', - [variant], - ) - - const labelContent = useMemo( - () => - variant === 'ready' ? ( - <>READY - ) : variant === 'running' ? ( - <>RUNNING - ) : variant === 'confirming' ? ( -
-
CONFIRMING
- -
- ) : ( -
- -
INSTANCE UNRESPONSIVE
-
- ), - [theme, variant], - ) - return ( -