import { t } from "@lingui/core/macro" import { CopyIcon, EyeIcon, EyeOffIcon } from "lucide-react" import { useState } from "react" import { Button } from "@/components/ui/button" import { copyToClipboard } from "@/lib/utils" /** Reduce accidental disclosure during screen sharing; this is not an access control. */ export function TokenValue({ token, label, disabled = false }: { token: string; label: string; disabled?: boolean }) { const [revealedToken, setRevealedToken] = useState(null) const revealed = !disabled && revealedToken === token return (
{label} {revealed ? token : "•".repeat(token.length)} {!revealed && {t`Token hidden`}}
) }