Skip to content

Commit f12102a

Browse files
remyluslosiusclaude
andcommitted
fix(frontend): Resolve TypeScript compilation error in ScanProgressDialog
- Fixed name conflict where Error icon from @mui/icons-material was shadowing global Error constructor - Renamed import to ErrorIcon to avoid collision - Added explicit type annotation for error response data - Resolves issue #75: All 6 TypeScript compilation errors now fixed TypeScript compilation now passes with zero errors. Impact: - CI pipeline will now pass TypeScript checks - Better type safety and IDE support - Improved developer experience 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent f229bd4 commit f12102a

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

frontend/src/components/host-groups/ScanProgressDialog.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import {
2323
} from '@mui/material';
2424
import {
2525
CheckCircle,
26-
Error,
26+
Error as ErrorIcon,
2727
Schedule,
2828
PlayArrow,
2929
Pause,
@@ -109,8 +109,9 @@ const ScanProgressDialog: React.FC<ScanProgressDialogProps> = ({
109109
setAutoRefresh(false);
110110
}
111111
} else {
112-
const errorData = await response.json();
113-
throw new (Error as any)(errorData.detail || 'Failed to fetch progress');
112+
const errorData: { detail?: string } = await response.json();
113+
const errorMessage = String(errorData.detail || 'Failed to fetch progress');
114+
throw new Error(errorMessage);
114115
}
115116
} catch (err: any) {
116117
setError(err.message || 'Failed to fetch progress');
@@ -166,7 +167,7 @@ const ScanProgressDialog: React.FC<ScanProgressDialogProps> = ({
166167
const getStatusIcon = (status: string) => {
167168
switch (status) {
168169
case 'completed': return <CheckCircle color="success" />;
169-
case 'failed': return <Error color="error" />;
170+
case 'failed': return <ErrorIcon color="error" />;
170171
case 'running': return <PlayArrow color="primary" />;
171172
case 'cancelled': return <Stop color="disabled" />;
172173
default: return <Schedule color="disabled" />;

0 commit comments

Comments
 (0)