import { Container, TextArea, Button, IconButton } from '@ifrc-go/ui'; import { DeleteBinLineIcon } from '@ifrc-go/icons'; import styles from '../../pages/UploadPage/UploadPage.module.css'; interface GeneratedTextSectionProps { description: string; analysis: string; recommendedActions: string; onDescriptionChange: (value: string | undefined) => void; onAnalysisChange: (value: string | undefined) => void; onRecommendedActionsChange: (value: string | undefined) => void; onBack: () => void; onDelete: () => void; onSubmit: () => void; onEditRatings?: () => void; isPerformanceConfirmed?: boolean; isSubmitting?: boolean; } export default function GeneratedTextSection({ description, analysis, recommendedActions, onDescriptionChange, onAnalysisChange, onRecommendedActionsChange, onBack, onDelete, onSubmit, onEditRatings, isPerformanceConfirmed = false, isSubmitting = false, }: GeneratedTextSectionProps) { const handleTextChange = (value: string | undefined) => { if (value) { const lines = value.split('\n'); const descIndex = lines.findIndex(line => line.startsWith('Description:')); const analysisIndex = lines.findIndex(line => line.startsWith('Analysis:')); const actionsIndex = lines.findIndex(line => line.startsWith('Recommended Actions:')); if (descIndex !== -1 && analysisIndex !== -1 && actionsIndex !== -1) { onDescriptionChange(lines.slice(descIndex + 1, analysisIndex).join('\n').trim()); onAnalysisChange(lines.slice(analysisIndex + 1, actionsIndex).join('\n').trim()); onRecommendedActionsChange(lines.slice(actionsIndex + 1).join('\n').trim()); } } }; return (