import React from "react"; import { useTranslation } from "react-i18next"; import { CopyToClipboardButton } from "#/components/shared/buttons/copy-to-clipboard-button"; import { I18nKey } from "#/i18n/declaration"; interface WorkspacePathProps { path?: string | null; } export function WorkspacePath({ path }: WorkspacePathProps) { const { t } = useTranslation("openhands"); const [isCopied, setIsCopied] = React.useState(false); const workspacePath = path?.trim(); React.useEffect(() => { if (!isCopied) return undefined; const timeout = window.setTimeout(() => setIsCopied(false), 2000); return () => window.clearTimeout(timeout); }, [isCopied]); if (!workspacePath) return null; const handleCopy = async () => { await navigator.clipboard.writeText(workspacePath); setIsCopied(true); }; return (