feat: enhance session management with sharing capabilities, real-time event synchronization, and UI updates for session display
This commit is contained in:
36
src/components/collaboration/LiveIndicator.tsx
Normal file
36
src/components/collaboration/LiveIndicator.tsx
Normal file
@@ -0,0 +1,36 @@
|
||||
'use client';
|
||||
|
||||
interface LiveIndicatorProps {
|
||||
isConnected: boolean;
|
||||
error?: string | null;
|
||||
}
|
||||
|
||||
export function LiveIndicator({ isConnected, error }: LiveIndicatorProps) {
|
||||
if (error) {
|
||||
return (
|
||||
<div className="flex items-center gap-2 rounded-full bg-destructive/10 px-3 py-1.5 text-sm text-destructive">
|
||||
<span className="h-2 w-2 rounded-full bg-destructive" />
|
||||
<span>Hors ligne</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`flex items-center gap-2 rounded-full px-3 py-1.5 text-sm transition-colors ${
|
||||
isConnected
|
||||
? 'bg-success/10 text-success'
|
||||
: 'bg-yellow/10 text-yellow'
|
||||
}`}
|
||||
>
|
||||
<span
|
||||
className={`h-2 w-2 rounded-full ${
|
||||
isConnected ? 'bg-success animate-pulse' : 'bg-yellow'
|
||||
}`}
|
||||
/>
|
||||
<span>{isConnected ? 'Live' : 'Connexion...'}</span>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user