({ isProcessing, stats = {
subdomainsParsed: 0,
pagesCrawled: 0,
dataExtracted: '0 KB',
errorsEncountered: 0
} }: ProcessingBlockProps)
| 20 | } |
| 21 | |
| 22 | export default function ProcessingBlock({ isProcessing, stats = { |
| 23 | subdomainsParsed: 0, |
| 24 | pagesCrawled: 0, |
| 25 | dataExtracted: '0 KB', |
| 26 | errorsEncountered: 0 |
| 27 | } }: ProcessingBlockProps) { |
| 28 | const progress = Math.min( |
| 29 | ((stats.subdomainsParsed + stats.pagesCrawled) / |
| 30 | (stats.subdomainsParsed > 0 ? stats.subdomainsParsed * 2 : 2)) * 100, |
| 31 | 100 |
| 32 | ) |
| 33 | |
| 34 | const statItems = [ |
| 35 | { |
| 36 | icon: Globe, |
| 37 | label: "Subdomains Parsed", |
| 38 | value: stats.subdomainsParsed, |
| 39 | color: "text-blue-400" |
| 40 | }, |
| 41 | { |
| 42 | icon: FileText, |
| 43 | label: "Pages Crawled", |
| 44 | value: stats.pagesCrawled, |
| 45 | color: "text-purple-400" |
| 46 | }, |
| 47 | { |
| 48 | icon: Database, |
| 49 | label: "Data Extracted", |
| 50 | value: stats.dataExtracted, |
| 51 | color: "text-green-400" |
| 52 | }, |
| 53 | { |
| 54 | icon: AlertTriangle, |
| 55 | label: "Errors Encountered", |
| 56 | value: stats.errorsEncountered, |
| 57 | color: "text-yellow-400" |
| 58 | } |
| 59 | ] |
| 60 | |
| 61 | return ( |
| 62 | <div className="w-full"> |
| 63 | <div className={` |
| 64 | flex items-center gap-3 p-3 mb-4 rounded-lg |
| 65 | transition-all duration-300 |
| 66 | ${isProcessing |
| 67 | ? 'bg-blue-500/10 text-blue-400' |
| 68 | : 'bg-gray-800/50 text-gray-400' |
| 69 | } |
| 70 | `}> |
| 71 | <div className="flex items-center gap-2"> |
| 72 | <Loader2 className={` |
| 73 | h-5 w-5 transition-opacity duration-300 |
| 74 | ${isProcessing ? 'animate-spin opacity-100' : 'opacity-0'} |
| 75 | `} /> |
| 76 | <span className="font-medium"> |
| 77 | {isProcessing ? 'Processing URL...' : 'Waiting for URL...'} |
| 78 | </span> |
| 79 | </div> |
nothing calls this directly
no outgoing calls
no test coverage detected