import React from 'react'; import { Box, Button, Typography, Alert, Chip, Divider, Accordion, AccordionSummary, AccordionDetails, Fade } from '@mui/material'; import { ExpandMore as ExpandMoreIcon, Refresh as RefreshIcon, Psychology as PsychologyIcon, AutoAwesome as AutoAwesomeIcon, Assessment as AssessmentIcon, LinkedIn as LinkedInIcon, Facebook as FacebookIcon, Twitter as TwitterIcon, Article as ArticleIcon, Instagram as InstagramIcon } from '@mui/icons-material'; import { CorePersonaDisplay } from './sections/CorePersonaDisplay'; import { PlatformPersonaDisplay } from './sections/PlatformPersonaDisplay'; import { QualityMetricsDisplay } from './QualityMetricsDisplay'; interface PersonaPreviewSectionProps { showPreview: boolean; corePersona: any; platformPersonas: Record; qualityMetrics: any; selectedPlatforms: string[]; expandedAccordion: string | false; setExpandedAccordion: (accordion: string | false) => void; setCorePersona: (persona: any) => void; setPlatformPersonas: (personas: Record) => void; handleRegenerate: () => void; } const availablePlatforms = [ { id: 'linkedin', name: 'LinkedIn', icon: , color: '#0077B5' }, { id: 'facebook', name: 'Facebook', icon: , color: '#1877F2' }, { id: 'twitter', name: 'Twitter', icon: , color: '#1DA1F2' }, { id: 'blog', name: 'Blog', icon: , color: '#FF6B35' }, { id: 'instagram', name: 'Instagram', icon: , color: '#E4405F' } ]; export const PersonaPreviewSection: React.FC = ({ showPreview, corePersona, platformPersonas, qualityMetrics, selectedPlatforms, expandedAccordion, setExpandedAccordion, setCorePersona, setPlatformPersonas, handleRegenerate }) => { if (!showPreview || !corePersona) { return null; } return ( Your AI Writing Brand Voice Comprehensive analysis of your unique brand identity and communication style } sx={{ mb: 4, borderRadius: 3, backgroundColor: '#f0f9ff', border: '1px solid #bae6fd', '& .MuiAlert-message': { color: '#0369a1' } }} > Adaptive Learning Active This Brand Voice was initialized from your website's home page. As you generate more content, ALwrity will automatically refine and update your brand identity to match your evolving style. {/* Core Persona */} setExpandedAccordion(expandedAccordion === 'core' ? false : 'core')} sx={{ mb: 3, background: 'linear-gradient(135deg, #ffffff 0%, #f8fafc 100%)', border: '1px solid #e2e8f0', borderRadius: 3, boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.05)', '&:before': { display: 'none' }, '&.Mui-expanded': { boxShadow: '0 10px 15px -3px rgba(0, 0, 0, 0.1)' } }} > } sx={{ px: 4, py: 3, '&:hover': { backgroundColor: '#f8fafc' } }} > Brand Writing Style Your unique brand voice and communication characteristics {qualityMetrics && ( )} { setCorePersona(updatedPersona); // TODO: Add debounced auto-save }} /> {/* Platform Adaptations */} setExpandedAccordion(expandedAccordion === 'platforms' ? false : 'platforms')} sx={{ mb: 3, background: 'linear-gradient(135deg, #ffffff 0%, #f8fafc 100%)', border: '1px solid #e2e8f0', borderRadius: 3, boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.05)', '&:before': { display: 'none' }, '&.Mui-expanded': { boxShadow: '0 10px 15px -3px rgba(0, 0, 0, 0.1)' } }} > } sx={{ px: 4, py: 3, '&:hover': { backgroundColor: '#f8fafc' } }} > Platform Adaptations Optimized for different content platforms {selectedPlatforms.map((platformId, index) => { const platformInfo = availablePlatforms.find(p => p.id === platformId); return ( { setPlatformPersonas({ ...platformPersonas, [platformId]: updatedPersona }); // TODO: Add debounced auto-save }} /> ); })} {selectedPlatforms.length === 0 && ( No platforms selected. Please select at least one platform to see optimized personas. )} {/* Quality Metrics */} {qualityMetrics && ( setExpandedAccordion(expandedAccordion === 'quality' ? false : 'quality')} sx={{ mb: 4, background: 'linear-gradient(135deg, #ffffff 0%, #f8fafc 100%)', border: '1px solid #e2e8f0', borderRadius: 3, boxShadow: '0 4px 6px -1px rgba(0, 0, 0, 0.05)', '&:before': { display: 'none' }, '&.Mui-expanded': { boxShadow: '0 10px 15px -3px rgba(0, 0, 0, 0.1)' } }} > } sx={{ px: 4, py: 3, '&:hover': { backgroundColor: '#f8fafc' } }} > Quality Assessment Performance metrics and recommendations = 85 ? 'linear-gradient(135deg, #10b981 0%, #059669 100%)' : qualityMetrics.overall_score >= 70 ? 'linear-gradient(135deg, #f59e0b 0%, #d97706 100%)' : 'linear-gradient(135deg, #ef4444 0%, #dc2626 100%)', color: 'white', fontWeight: 600, '& .MuiChip-label': { px: 2 } }} size="small" /> )} ); };