From 8df6612f8c597224b75f928a4d186ad51defcec1 Mon Sep 17 00:00:00 2001 From: Nick Marais Date: Thu, 30 Oct 2025 08:17:05 +0000 Subject: [PATCH] fix: Bot instance health status dot inconsistency --- .../src/BotInstances/Details/HealthTab.tsx | 2 +- .../src/BotInstances/Details/InfoTab.tsx | 21 ++----------------- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/web/packages/teleport/src/BotInstances/Details/HealthTab.tsx b/web/packages/teleport/src/BotInstances/Details/HealthTab.tsx index a41ac8a660d5a..8036fa917a7ea 100644 --- a/web/packages/teleport/src/BotInstances/Details/HealthTab.tsx +++ b/web/packages/teleport/src/BotInstances/Details/HealthTab.tsx @@ -123,7 +123,7 @@ const ItemContainer = styled(Flex)` gap: ${({ theme }) => theme.space[3]}px; `; -const HealthStatusDot = styled.div<{ +export const HealthStatusDot = styled.div<{ $status: BotInstanceServiceHealthStatus | undefined; }>` width: ${({ theme }) => theme.space[3] - theme.space[1]}px; diff --git a/web/packages/teleport/src/BotInstances/Details/InfoTab.tsx b/web/packages/teleport/src/BotInstances/Details/InfoTab.tsx index 80d41b6d054bd..393bab7e678ae 100644 --- a/web/packages/teleport/src/BotInstances/Details/InfoTab.tsx +++ b/web/packages/teleport/src/BotInstances/Details/InfoTab.tsx @@ -38,6 +38,8 @@ import { GetBotInstanceResponseJoinAttrs, } from 'teleport/services/bot/types'; +import { HealthStatusDot } from './HealthTab'; + export function InfoTab(props: { data: GetBotInstanceResponse; onGoToServicesClick: () => void; @@ -251,25 +253,6 @@ const HealthLabelText = styled(Text).attrs({ white-space: nowrap; `; -const HealthStatusDot = styled.div<{ - $status: BotInstanceServiceHealthStatus | undefined; -}>` - width: ${props => props.theme.space[3] - props.theme.space[1]}px; - height: ${props => props.theme.space[3] - props.theme.space[1]}px; - border-radius: 999px; - background-color: ${({ theme, $status }) => - $status === - BotInstanceServiceHealthStatus.BOT_INSTANCE_HEALTH_STATUS_HEALTHY - ? theme.colors.interactive.solid.success.default - : $status === - BotInstanceServiceHealthStatus.BOT_INSTANCE_HEALTH_STATUS_UNHEALTHY - ? theme.colors.interactive.solid.danger.default - : $status === - BotInstanceServiceHealthStatus.BOT_INSTANCE_HEALTH_STATUS_UNSPECIFIED - ? theme.colors.interactive.solid.alert.default - : theme.colors.interactive.tonal.neutral[1]}; -`; - const AccentCountText = styled(Text)` font-size: ${({ theme }) => theme.fontSizes[8]}px; font-weight: ${({ theme }) => theme.fontWeights.light}px;