import React, { useState, useEffect } from 'react'; import type { AgentReview, SubReview, RagStatus, OverallStatus } from '../types'; import { CheckCircleIcon, ExclamationTriangleIcon, InformationCircleIcon } from './icons/StatusIcons'; import { FlagIcon } from './icons/FlagIcon'; import { XIcon } from './icons/XIcon'; import { BugIcon } from './icons/BugIcon'; import { ExportIcon } from './icons/ExportIcon'; import { LegalIcon } from './icons/LegalIcon'; /** * Formats feedback text from Gemini API into properly structured React elements. * Handles HTML tags, bullet characters, and newline-separated text. */ const formatFeedbackText = (text: string): React.ReactNode => { if (!text) return null; // First, handle HTML tags by converting them to a normalized format let normalizedText = text // Replace and with newlines .replace(/<\/li>/gi, '\n') .replace(/<\/ul>/gi, '\n') // Remove opening tags .replace(/
{introLines.join(' ')}
)} {bulletLines.length > 0 && (Please provide a reason for manually resolving this issue.
Reporting incorrect feedback from {agentName}
This proof has been identified as a financial promotion and requires a separate, manual review from the Barclays legal team.
Reason Identified
"{reason}"