diff --git a/src/components/wrappers/common/connection-indicator.tsx b/src/components/wrappers/common/connection-indicator.tsx index 0f4cc863..8812932c 100644 --- a/src/components/wrappers/common/connection-indicator.tsx +++ b/src/components/wrappers/common/connection-indicator.tsx @@ -1,19 +1,17 @@ -import { cn } from "@/lib/utils"; +import {cn} from "@/lib/utils"; export type ConnectionIndicatorProps = { date?: Date | null; }; -export const ConnectionIndicator = ({ date }: ConnectionIndicatorProps) => { +export const ConnectionIndicator = ({date}: ConnectionIndicatorProps) => { let style = "bg-gray-300"; - let active = false; if (date instanceof Date && !isNaN(date.getTime())) { const intervalSeconds = (Date.now() - date.getTime()) / 1000; if (intervalSeconds < 55) { style = "bg-green-500"; - active = true; } else if (intervalSeconds <= 60) { style = "bg-orange-400"; } else { @@ -22,8 +20,8 @@ export const ConnectionIndicator = ({ date }: ConnectionIndicatorProps) => { } return ( -
- {active && ( +
+ { animationDuration: "2s", }} /> - )} +