/** * Platform Persona Chat Test Component * Demonstrates and tests the PlatformPersonaChat component * Shows how to integrate persona-aware chat into different platforms */ import React, { useState } from 'react'; import { PlatformPersonaProvider } from '../PersonaContext'; import { PlatformPersonaChat } from './index'; import { PlatformType } from '../../types/PlatformPersonaTypes'; // Platform selection component const PlatformSelector: React.FC<{ selectedPlatform: PlatformType; onPlatformChange: (platform: PlatformType) => void; }> = ({ selectedPlatform, onPlatformChange }) => { const platforms: { value: PlatformType; label: string; description: string }[] = [ { value: 'linkedin', label: 'LinkedIn', description: 'Professional networking & thought leadership' }, { value: 'facebook', label: 'Facebook', description: 'Community building & social engagement' }, { value: 'instagram', label: 'Instagram', description: 'Visual storytelling & aesthetic content' }, { value: 'twitter', label: 'Twitter', description: 'Concise messaging & viral potential' }, { value: 'blog', label: 'Blog', description: 'Long-form content & SEO optimization' }, { value: 'medium', label: 'Medium', description: 'Storytelling & publication strategy' }, { value: 'substack', label: 'Substack', description: 'Newsletter & subscription focus' } ]; return (

Select Platform to Test

{platforms.map((platform) => ( ))}
); }; // Chat configuration options const ChatConfigOptions: React.FC<{ showWelcomeMessage: boolean; showSuggestedPrompts: boolean; onToggleWelcomeMessage: () => void; onToggleSuggestedPrompts: () => void; }> = ({ showWelcomeMessage, showSuggestedPrompts, onToggleWelcomeMessage, onToggleSuggestedPrompts }) => { return (

Chat Configuration

); }; // Main test component export const PlatformPersonaChatTest: React.FC = () => { const [selectedPlatform, setSelectedPlatform] = useState('linkedin'); const [showWelcomeMessage, setShowWelcomeMessage] = useState(true); const [showSuggestedPrompts, setShowSuggestedPrompts] = useState(true); const toggleWelcomeMessage = () => setShowWelcomeMessage(!showWelcomeMessage); const toggleSuggestedPrompts = () => setShowSuggestedPrompts(!showSuggestedPrompts); return (

Platform Persona Chat Test

Test the persona-aware CopilotKit integration across different platforms

{/* Platform Selector */} {/* Chat Configuration */} {/* Persona Chat Component */}

{selectedPlatform.charAt(0).toUpperCase() + selectedPlatform.slice(1)} Persona Chat

AI-powered content assistance with your personal writing style

{/* Usage Instructions */}

How to Test

  • • Select different platforms to see platform-specific chat configurations
  • • Toggle welcome message and suggested prompts to test different chat modes
  • • Ask questions about content strategy, writing style, or platform optimization
  • • Notice how the AI adapts responses to your persona and platform constraints
  • • Try the quick action buttons for platform-specific suggestions
{/* Technical Details */}

Technical Implementation

Context Injection: The chat automatically receives your writing persona, linguistic fingerprint, and platform-specific constraints through CopilotKit's context system.

Dynamic System Messages: System messages are generated dynamically based on your persona data and selected platform, ensuring AI responses match your writing style.

Platform Optimization: Each platform has specific character limits, engagement patterns, and best practices that are automatically incorporated into AI responses.

); }; export default PlatformPersonaChatTest;