AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents
TypeScript ai-agentai-agent-toolsai-agentsai-agents-frameworkmcpmcp-servermcp-toolsmcpsn8n-alternativeno-code-automationworkflowworkflow-automationworkflows
import { Input } from '@/components/ui/input';
import { Textarea } from '@/components/ui/textarea';
import { AdminControl, adminControl } from '@/lib/admin-control';
import { cn } from '@/lib/utils';
import { DownloadButton } from '../download-button';
import { CopyButton } from './copy-button';
type CopyToClipboardInputProps = {
textToCopy: string;
useInput: boolean;
fileName?: string;
controlId?: AdminControl;
};
const noBorderInputClass = `border-none w-full focus-visible:ring-transparent focus-visible:ring-offset-0`;
const CopyToClipboardInput = ({
textToCopy,
fileName,
useInput,
controlId,
}: CopyToClipboardInputProps) => {
return (
<div className="flex gap-2 items-center bg-gray-1 border border-solid text-sm rounded-md block w-full select-none pr-3">
{useInput ? (
<Input value={textToCopy} className={noBorderInputClass} readOnly />
) : (
<Textarea
value={textToCopy}
rows={6}
className={noBorderInputClass}
readOnly
/>
)}
<div
className={cn('flex gap-1', {
'flex-col': !useInput,
})}
>
<CopyButton
textToCopy={textToCopy}
variant="ghost"
{...adminControl(controlId)}
/>
{fileName && (
<DownloadButton
textToDownload={textToCopy}
fileName={fileName}
variant="ghost"
tooltipSide="bottom"
/>
)}
</div>
</div>
);
};
CopyToClipboardInput.displayName = 'CopyToClipboardInput';
export { CopyToClipboardInput };