We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0dc7720 commit 02a9ae3Copy full SHA for 02a9ae3
1 file changed
src/components/ui/StatusIndicator.tsx
@@ -0,0 +1,10 @@
1
+import React from 'react';
2
+interface Props { status: 'online' | 'offline' | 'busy' | 'away'; showLabel?: boolean; size?: 'sm' | 'md'; }
3
+const colors = { online: 'bg-green-500', offline: 'bg-gray-400', busy: 'bg-red-500', away: 'bg-yellow-500' };
4
+const StatusIndicator: React.FC<Props> = ({ status, showLabel = false, size = 'sm' }) => (
5
+ <span className='inline-flex items-center gap-1.5'>
6
+ <span className={'rounded-full ' + colors[status] + ' ' + (size === 'sm' ? 'w-2.5 h-2.5' : 'w-3.5 h-3.5')} />
7
+ {showLabel && <span className='text-xs font-medium text-gray-500 capitalize'>{status}</span>}
8
+ </span>
9
+);
10
+export default StatusIndicator;
0 commit comments