import React from 'react'; import { motion } from 'framer-motion'; const ProcessingProgress = ({ progress, isVisible }) => { if (!isVisible) return null; const { current, total, status, fileName, totalPages, currentPage, totalCharacters, pageCharacters, phase, consoleLogs = [] } = progress; const percentage = total > 0 ? Math.round((current / total) * 100) : 0; return (

🌙 Luna Processing

📄 {fileName || 'Processing file...'}
{percentage}%
{status && ( {status} )}
{totalPages > 1 && (
{currentPage || 0} / {totalPages} pages
{totalCharacters > 0 && (
Total Characters: {totalCharacters.toLocaleString()}
{pageCharacters > 0 && (
Last Page: {pageCharacters.toLocaleString()} chars
)}
)}
)} {consoleLogs.length > 0 && (
📋 Live Process Log
{consoleLogs.slice(-6).map((log, index) => (
{new Date(log.timestamp).toLocaleTimeString('th-TH', { hour12: false, hour: '2-digit', minute: '2-digit', second: '2-digit' })} {log.message}
))}
)}
); }; export default ProcessingProgress;