Files
gunshiz e0794822b1
CI / Verify (push) Successful in 1m18s
CI / Build immutable images and deploy (push) Successful in 1m57s
feat(i18n) : add personal languages and compact weapon exports
2026-09-14 16:44:44 +07:00

28 lines
955 B
TypeScript

"use client";
import { useTranslation } from "@/components/i18n/locale-provider";
import { UsersIcon } from "lucide-react";
import { Badge } from "@/components/ui/badge";
import { useAdminPresence } from "@/hooks/use-presence";
export function EditorPresence({ guideId, section }: { guideId: string; section: string }) {
const { t } = useTranslation();
const presence = useAdminPresence(guideId, section);
const editors = presence?.editorsByGuide[guideId] ?? [];
return (
<div className="flex flex-wrap items-center gap-1" aria-live="polite">
<Badge variant="secondary">
<UsersIcon data-icon="inline-start" />
{t("Editing")}{" "}{editors.length || (presence ? 0 : "")}
</Badge>
{editors.map((editor) => (
<Badge key={editor.userId} variant="outline">
{editor.name}
{editor.sections.length ? ` · ${editor.sections.join(", ")}` : ""}
</Badge>
))}
</div>
);
}