import React, { useMemo } from 'react';
import { Heart } from 'lucide-react';
import { motion } from 'framer-motion';
import { LineChart, Line, XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer } from 'recharts';
import { TypewriterText } from './common/TypewriterText';
import { ContentCard } from './common/ContentCard';
import { SkeletonCard } from './common/SkeletonCard';
import { IconLoading } from './common/IconLoading';
interface ScriptContent {
acts?: Array<{
id: string;
stableId: string;
title: string;
desc: string;
beats: string[];
}>;
characters?: Array<{
id: string;
stableId: string;
name: string;
role: string;
arc: string;
desc: string;
color: string;
}>;
dialogue?: {
stableId: string;
rhythm: string;
style: string;
};
themes?: Array<{
id: string;
stableId: string;
theme: string;
desc: string;
depth: string;
}>;
dramaticLine?: {
stableId: string;
points: Array<{
id: string;
stableId: string;
title: string;
desc: string;
intensity: number; // 0-100 情感强度
}>;
};
}
interface ScriptwriterProps {
currentContent: ScriptContent;
isPlaying: boolean;
}
const CustomTooltip = ({ active, payload, label }: any) => {
if (active && payload && payload.length) {
return (
{payload[0].payload.title}
{`Emotional intensity: ${payload[0].value}`}
);
}
return null;
};
// Three-act Structure Component
const ThreeActStructure = React.memo(({ acts, isPlaying }: { acts?: ScriptContent['acts']; isPlaying: boolean }) => {
return (
Three-act structure
{acts && acts.length > 0 ? (
acts.map((act) => (
{act.title}
{act.beats?.map((beat, index) => (
{beat}
))}
))
) : (
Array.from({length: 3}, (_, i) => (
))
)}
);
});
// Character Arc Design Component
const CharacterArcDesign = React.memo(({ characters, isPlaying }: { characters?: ScriptContent['characters']; isPlaying: boolean }) => {
return (
Character arc design
{characters && characters.length > 0 ? (
characters.map((char) => (
{char.name}
({char.role})
{char.arc}
))
) : (
Array.from({length: 3}, (_, i) => (
))
)}
);
});
// Dialogue Rhythm Component
const DialogueRhythm = React.memo(({ dialogue, isPlaying }: { dialogue?: ScriptContent['dialogue']; isPlaying: boolean }) => {
return (
Dialogue rhythm
{dialogue ? (
) : (
)}
);
});
// Theme Development Component
const ThemeDevelopment = React.memo(({ themes, isPlaying }: { themes?: ScriptContent['themes']; isPlaying: boolean }) => {
return (
Theme deepening process
{themes ? (
themes.map((theme) => (
{theme.theme}
))
) : (
Array.from({length: 2}, (_, i) => (
))
)}
);
});
// Dramatic Line Component
const DramaticLine = React.memo(({ dramaticLine, isPlaying }: { dramaticLine?: ScriptContent['dramaticLine']; isPlaying: boolean }) => {
return (
Dramatic line
{dramaticLine ? (
} />
{dramaticLine.points?.map((point) => (
{point.title}
))}
) : (
)}
);
});
const Scriptwriter: React.FC = React.memo(({ currentContent, isPlaying }) => {
return (
{/* 左侧:三幕结构和角色弧光 */}
{/* 右侧:对白节奏和主题深化 */}
);
});
Scriptwriter.displayName = 'Scriptwriter';
export default Scriptwriter;