Chuyển tới nội dung chính

ConnectionStatus

A status indicator component showing real-time connection status to backend services.

📋 Overview

PropertyValue
Filesrc/components/ConnectionStatus.tsx
TypeReact Functional Component
AuthorUIP Team
Version1.0.0

🎯 Purpose

  • Display WebSocket connection status
  • Show API connectivity state
  • Indicate data freshness
  • Auto-reconnection feedback

🚀 Usage

import { ConnectionStatus } from '@/components/ConnectionStatus';

function Header() {
return (
<header>
<ConnectionStatus />
</header>
);
}

📦 Props

PropTypeRequiredDefaultDescription
showLabelbooleanNotrueShow status text
size'sm' | 'md' | 'lg'No'md'Indicator size
position'inline' | 'fixed'No'inline'Display position

🎨 Status Indicators

StatusColorLabel
Connected🟢 GreenConnected
Connecting🟡 YellowConnecting...
Disconnected🔴 RedDisconnected
Reconnecting🟠 OrangeReconnecting...

See the complete components reference for all available components.