Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | 'use client' /** * ParsingProgressOverlay - Overlay on photo tile during worksheet parsing * * Shows: * - Semi-transparent dark background * - Spinner animation * - Progress message with problem count * - Cancel button * - Toggle to show/hide reasoning panel */ import { css } from '../../../styled-system/css' export interface ParsingProgressOverlayProps { /** Progress message to display */ progressMessage: string | null /** Number of completed problems (for count display) */ completedCount: number /** Total expected problems (for count display, 0 if unknown) */ totalCount?: number /** Whether the reasoning panel is expanded */ isPanelExpanded: boolean /** Toggle reasoning panel visibility */ onTogglePanel: () => void /** Cancel parsing */ onCancel: () => void /** Whether there is reasoning text to show */ hasReasoningText: boolean } export function ParsingProgressOverlay({ progressMessage, completedCount, totalCount = 0, isPanelExpanded, onTogglePanel, onCancel, hasReasoningText, }: ParsingProgressOverlayProps) { // Build progress text const progressText = completedCount > 0 ? totalCount > 0 ? `${completedCount}/${totalCount} problems` : `${completedCount} problems found` : progressMessage || 'Analyzing...' return ( <div data-component="parsing-progress-overlay" className={css({ position: 'absolute', inset: 0, display: 'flex', flexDirection: 'column', alignItems: 'center', justifyContent: 'center', backgroundColor: 'rgba(0, 0, 0, 0.65)', borderRadius: '12px', zIndex: 10, gap: '0.75rem', padding: '1rem', })} > {/* Spinner */} <div className={css({ width: '32px', height: '32px', border: '3px solid rgba(255, 255, 255, 0.3)', borderTopColor: 'white', borderRadius: 'full', animation: 'spin 1s linear infinite', })} /> {/* Progress text */} <div className={css({ color: 'white', fontSize: '0.875rem', fontWeight: 'medium', textAlign: 'center', lineHeight: '1.4', })} > {progressText} </div> {/* Action buttons */} <div className={css({ display: 'flex', gap: '0.5rem', marginTop: '0.25rem', })} > {/* Cancel button */} <button type="button" onClick={(e) => { e.stopPropagation() onCancel() }} className={css({ minWidth: '44px', minHeight: '32px', paddingX: '0.75rem', paddingY: '0.375rem', backgroundColor: 'rgba(255, 255, 255, 0.15)', color: 'white', fontSize: '0.75rem', fontWeight: 'medium', borderRadius: '6px', border: '1px solid rgba(255, 255, 255, 0.25)', cursor: 'pointer', transition: 'background-color 0.15s', _hover: { backgroundColor: 'rgba(255, 255, 255, 0.25)', }, _active: { backgroundColor: 'rgba(255, 255, 255, 0.3)', }, })} > Cancel </button> {/* Show/Hide thinking toggle */} {hasReasoningText && ( <button type="button" onClick={(e) => { e.stopPropagation() onTogglePanel() }} className={css({ minWidth: '44px', minHeight: '32px', paddingX: '0.75rem', paddingY: '0.375rem', backgroundColor: isPanelExpanded ? 'rgba(59, 130, 246, 0.5)' : 'rgba(255, 255, 255, 0.15)', color: 'white', fontSize: '0.75rem', fontWeight: 'medium', borderRadius: '6px', border: '1px solid', borderColor: isPanelExpanded ? 'rgba(59, 130, 246, 0.7)' : 'rgba(255, 255, 255, 0.25)', cursor: 'pointer', transition: 'background-color 0.15s, border-color 0.15s', display: 'flex', alignItems: 'center', gap: '0.25rem', _hover: { backgroundColor: isPanelExpanded ? 'rgba(59, 130, 246, 0.6)' : 'rgba(255, 255, 255, 0.25)', }, })} > <span className={css({ transition: 'transform 0.2s', transform: isPanelExpanded ? 'rotate(180deg)' : 'rotate(0deg)', })} > ▼ </span> {isPanelExpanded ? 'Hide' : 'Show'} </button> )} </div> </div> ) } |