import { useState } from "react" import { Check, Copy, Link2 } from "lucide-react" import { Button } from "@workspace/ui/components/button" type Copied = "code" | "link" | null /** Code de room copiable + bouton pour copier le lien d'invitation. */ export function RoomCode({ code }: { code: string }) { const [copied, setCopied] = useState(null) async function copy(what: Copied, text: string) { try { await navigator.clipboard.writeText(text) setCopied(what) setTimeout(() => setCopied(null), 1500) } catch { // presse-papier indisponible (http non sécurisé) : on ignore silencieusement } } const link = `${window.location.origin}/join/${code}` return (
) }