import { useCopy } from "../../ui/copy"; import { Comic } from "./Comic"; export function RoomCodeInput({ value, onChange, rejectedAttempt = 0, autoFocus = false }: { value: string; onChange: (value: string) => void; rejectedAttempt?: number; autoFocus?: boolean; }) { const { t } = useCopy(); return
0} onChange={event => onChange(event.target.value.replace(/\D/g, "").slice(0, 4))} />
; } export function RoomCodeError({ attempt, theme = "paper" }: { attempt: number; theme?: "paper" | "stage" }) { const { t, vis } = useCopy(); if (!attempt) return null; // The message is inside the live region; another rejection re-announces it. return {t("join.invalid")} ; }