slideshare/src/components/slide-editor/ErrorState.tsx
Michael Mainguy 127b0fe96a Refactor SlideEditor component and consolidate CSS
- Move SlideEditor to dedicated slide-editor directory structure
- Break down monolithic 471-line component into smaller, focused modules:
  - SlideEditor.tsx (127 lines) - main component using composition
  - useSlideEditor.ts (235 lines) - custom hook for state management
  - ContentEditor.tsx - focused content editing component
  - SlidePreviewModal.tsx - modal for fullscreen preview
- Consolidate CSS from 838+132 lines to 731 lines with:
  - Comprehensive CSS variables system for consistent theming
  - Remove duplicate .slide-preview-wrapper rules and conflicts
  - Clean aspect ratio handling with clear separation of contexts
- Follow project standards: direct imports, error boundaries, under 200 lines per component
- Maintain all existing functionality while improving code organization

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-21 11:25:59 -05:00

65 lines
1.9 KiB
TypeScript

import React from 'react';
import { Link } from 'react-router-dom';
interface ErrorStateProps {
error: string;
presentationId?: string;
}
export const ErrorState: React.FC<ErrorStateProps> = ({ error, presentationId }) => {
return (
<div className="slide-editor">
<header className="slide-editor-header">
<div className="editor-info">
{presentationId ? (
<Link to={`/presentations/${presentationId}/edit/slides/1`} className="back-button">
Back to Presentation
</Link>
) : (
<Link to="/presentations" className="back-button">
Back to Presentations
</Link>
)}
<div className="editor-title">
<h1>Slide Editor Error</h1>
</div>
</div>
</header>
<main className="slide-editor-content">
<div className="error-container">
<div className="error-content">
<h2>Unable to Load Slide Editor</h2>
<p>{error}</p>
<div className="error-actions">
<button
type="button"
onClick={() => window.location.reload()}
className="action-button primary"
>
Reload Page
</button>
{presentationId ? (
<Link
to={`/presentations/${presentationId}/edit/slides/1`}
className="action-button secondary"
>
Return to Presentation
</Link>
) : (
<Link
to="/presentations"
className="action-button secondary"
>
Back to Presentations
</Link>
)}
</div>
</div>
</div>
</main>
</div>
);
};