feat : update
This commit is contained in:
@@ -5,8 +5,8 @@ import { UsersIcon } from "lucide-react";
|
||||
import { Badge } from "@/components/ui/badge";
|
||||
import { useAdminPresence } from "@/hooks/use-presence";
|
||||
|
||||
export function EditorPresence({ guideId }: { guideId: string }) {
|
||||
const presence = useAdminPresence(guideId);
|
||||
export function EditorPresence({ guideId, section }: { guideId: string; section: string }) {
|
||||
const presence = useAdminPresence(guideId, section);
|
||||
const editors = presence?.editorsByGuide[guideId] ?? [];
|
||||
return (
|
||||
<div className="flex flex-wrap items-center gap-1" aria-live="polite">
|
||||
@@ -15,7 +15,10 @@ export function EditorPresence({ guideId }: { guideId: string }) {
|
||||
Editing {editors.length || (presence ? 0 : "")}
|
||||
</Badge>
|
||||
{editors.map((editor) => (
|
||||
<Badge key={editor.userId} variant="outline">{editor.name}</Badge>
|
||||
<Badge key={editor.userId} variant="outline">
|
||||
{editor.name}
|
||||
{editor.sections.length ? ` · ${editor.sections.join(", ")}` : ""}
|
||||
</Badge>
|
||||
))}
|
||||
</div>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user