import React from "react"; import { Check, Copy, Eye, EyeOff } from "lucide-react"; import { cn } from "../../../../lib/utils"; import { useI18n } from "../../../../application/i18n/I18nProvider"; import { Button } from "../../../ui/button"; type CopyableCodeBlockProps = { label?: string; sensitive?: boolean; value: string; copyKey: string; copied: string | null; onCopy: (key: string, text: string) => void; copyLabel: string; copiedLabel: string; emptyLabel?: string; className?: string; }; export const CopyableCodeBlock: React.FC = ({ label, sensitive = false, value, copyKey, copied, onCopy, copyLabel, copiedLabel, emptyLabel, className, }) => { const { t } = useI18n(); const [revealed, setRevealed] = React.useState(false); const display = sensitive && value && !revealed ? "••••••••" : value || emptyLabel || ""; const canCopy = Boolean(value); const isCopied = copied === copyKey; return (
{label ? (
{label}
) : null}
          {display}
        
{sensitive && value ? : null}
); };