feat: refactor session components to utilize BaseSessionLiveWrapper, streamlining sharing functionality and reducing code duplication across various session types
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m14s
All checks were successful
Deploy with Docker Compose / deploy (push) Successful in 3m14s
This commit is contained in:
51
src/components/collaboration/CollaborationToolbar.tsx
Normal file
51
src/components/collaboration/CollaborationToolbar.tsx
Normal file
@@ -0,0 +1,51 @@
|
||||
'use client';
|
||||
|
||||
import { LiveIndicator } from './LiveIndicator';
|
||||
import { ShareButton } from './ShareButton';
|
||||
import { CollaboratorAvatars } from './CollaboratorAvatars';
|
||||
import type { Share } from '@/lib/share-utils';
|
||||
|
||||
interface CollaborationToolbarProps {
|
||||
isConnected: boolean;
|
||||
error: string | null;
|
||||
lastEventUser: string | null;
|
||||
canEdit: boolean;
|
||||
shares: Share[];
|
||||
onShareClick: () => void;
|
||||
}
|
||||
|
||||
export function CollaborationToolbar({
|
||||
isConnected,
|
||||
error,
|
||||
lastEventUser,
|
||||
canEdit,
|
||||
shares,
|
||||
onShareClick,
|
||||
}: CollaborationToolbarProps) {
|
||||
return (
|
||||
<div className="mb-4 flex items-center justify-between rounded-lg border border-border bg-card p-3">
|
||||
<div className="flex items-center gap-4">
|
||||
<LiveIndicator isConnected={isConnected} error={error} />
|
||||
|
||||
{lastEventUser && (
|
||||
<div className="flex items-center gap-2 text-sm text-muted animate-pulse">
|
||||
<span>✏️</span>
|
||||
<span>{lastEventUser} édite...</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{!canEdit && (
|
||||
<div className="flex items-center gap-2 rounded-full bg-yellow/10 px-3 py-1.5 text-sm text-yellow">
|
||||
<span>👁️</span>
|
||||
<span>Mode lecture</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2">
|
||||
<CollaboratorAvatars shares={shares} />
|
||||
<ShareButton onClick={onShareClick} />
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user