import React from 'react'; import { Box, Typography, Button, Paper, Chip, CircularProgress } from '@mui/material'; import ThumbUpIcon from '@mui/icons-material/ThumbUp'; import ThumbDownIcon from '@mui/icons-material/ThumbDown'; import RemoveIcon from '@mui/icons-material/Remove'; import ArrowBackIcon from '@mui/icons-material/ArrowBack'; function SentimentResult({ result, onNewAnalysis, currentReview }) { const sentimentColor = result.sentiment === 'positive' ? 'success.main' : result.sentiment === 'negative' ? 'secondary.main' : 'warning.main'; const SentimentIcon = result.sentiment === 'positive' ? ThumbUpIcon : result.sentiment === 'negative' ? ThumbDownIcon : RemoveIcon; return ( Sentiment Analysis Result Sentiment: } label={result.sentiment.charAt(0).toUpperCase() + result.sentiment.slice(1)} sx={{ bgcolor: sentimentColor, color: 'white', fontWeight: 'bold', fontSize: '1rem', px: 1, py: 2.5 }} /> Confidence: {`${Math.round(result.confidence)}%`} {result.reasoning && ( Analysis Details: {result.reasoning} )} Original Review Text: {currentReview} ); } export default SentimentResult;