import React, { useState } from 'react'; const CodePreview = ({ code, path, testResult }) => { const [copied, setCopied] = useState(false); const copyToClipboard = () => { if (code) { navigator.clipboard.writeText(code); setCopied(true); setTimeout(() => setCopied(false), 2000); } }; if (!code) { return (
📝

Generated code will appear here

Fill out the form and click "Generate Agent"

); } return (

Code Preview

{path && Saved to {path.split('/').pop()}}
                    {code}
                
💡 Tip: Save this code to a .py file and run it with your API key set.
{testResult && (

Test Result

{testResult}
)}
); }; export default CodePreview;