Skip to content

Commit 393f243

Browse files
fix(spec-page): handle not found error state with NotFoundPage component
1 parent 0a8c90c commit 393f243

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app/src/pages/SpecPage.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Tooltip from '@mui/material/Tooltip';
88
import Skeleton from '@mui/material/Skeleton';
99
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
1010
import BugReportIcon from '@mui/icons-material/BugReport';
11+
import { NotFoundPage } from './NotFoundPage';
1112

1213
import { API_URL, GITHUB_URL } from '../constants';
1314
import { useAnalytics } from '../hooks';
@@ -192,11 +193,14 @@ export function SpecPage() {
192193
}
193194

194195
// Error state
195-
if (error || !specData) {
196+
if (error === 'Spec not found' || (!error && !specData)) {
197+
return <NotFoundPage />;
198+
}
199+
if (error) {
196200
return (
197201
<Box sx={{ textAlign: 'center', py: 8 }}>
198202
<Typography variant="h5" sx={{ mb: 2, color: '#6b7280' }}>
199-
{error || 'Spec not found'}
203+
{error}
200204
</Typography>
201205
<Button component={Link} to="/" startIcon={<ArrowBackIcon />} sx={{ color: '#3776AB' }}>
202206
Back to Home

0 commit comments

Comments
 (0)