import React, { useState } from 'react'; import { useCopilotAction } from '@copilotkit/react-core'; const useCopilotActionTyped = useCopilotAction as any; interface CustomOutlineFormProps { onOutlineCreated?: (outline: any) => void; } export const CustomOutlineForm: React.FC = ({ onOutlineCreated }) => { const [customInstructions, setCustomInstructions] = useState(''); const [isSubmitting, setIsSubmitting] = useState(false); useCopilotActionTyped({ name: 'getCustomOutlineInstructions', description: 'Get custom instructions from user for outline generation', parameters: [ { name: 'prompt', type: 'string', description: 'Prompt to show user', required: false } ], renderAndWaitForResponse: ({ respond, args, status }: { respond?: (value: string) => void; args: { prompt?: string }; status: string }) => { if (status === 'complete') { return (

✅ Custom outline instructions received! Creating your personalized outline...

); } return (

🎨 Create Custom Outline

{args.prompt || 'Tell me your specific requirements for the blog outline. What should it focus on? What structure do you prefer?'}