Skip to content

Commit 02a9ae3

Browse files
committed
feat(ui): add StatusIndicator component
1 parent 0dc7720 commit 02a9ae3

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)