## Major Refactoring - Broke down large components into focused, reusable pieces - Reduced NewPresentationPage.tsx from 238 to 172 lines - Reduced PresentationEditor.tsx from 457 to 261 lines - Eliminated functions exceeding 50-line guideline ## New Reusable Components - PresentationDetailsForm: Form inputs for title/description - AspectRatioSelector: Aspect ratio selection grid - ThemeSelectionSection: Theme selection wrapper - CreationActions: Action buttons and selected theme info - EmptyPresentationState: Empty presentation state display - SlidesSidebar: Complete sidebar with slides list - SlideThumbnail: Individual slide thumbnail with actions - LoadingState: Reusable loading component with spinner - ErrorState: Reusable error display with retry/back actions ## New Hooks - useSlideOperations: Custom hook for slide duplicate/delete logic ## Code Quality Improvements - Replaced browser alert() calls with AlertDialog component - Updated imports to use direct .tsx extensions per IMPORT_STANDARDS.md - Eliminated browser confirm() calls in favor of ConfirmDialog system - Consolidated duplicate loading/error state patterns - Improved type safety throughout ## Benefits - Better maintainability through component separation - Consistent UX with shared UI components - Code reuse across presentation components - Compliance with 200-line file guideline 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
46 lines
1.2 KiB
TypeScript
46 lines
1.2 KiB
TypeScript
import React from 'react';
|
|
import './PresentationDetailsForm.css';
|
|
|
|
interface PresentationDetailsFormProps {
|
|
title: string;
|
|
description: string;
|
|
onTitleChange: (title: string) => void;
|
|
onDescriptionChange: (description: string) => void;
|
|
}
|
|
|
|
export const PresentationDetailsForm: React.FC<PresentationDetailsFormProps> = ({
|
|
title,
|
|
description,
|
|
onTitleChange,
|
|
onDescriptionChange
|
|
}) => {
|
|
return (
|
|
<section className="presentation-details">
|
|
<h2>Presentation Details</h2>
|
|
<div className="form-group">
|
|
<label htmlFor="title">Title *</label>
|
|
<input
|
|
id="title"
|
|
type="text"
|
|
value={title}
|
|
onChange={(e) => onTitleChange(e.target.value)}
|
|
placeholder="Enter presentation title"
|
|
className="form-input"
|
|
required
|
|
/>
|
|
</div>
|
|
|
|
<div className="form-group">
|
|
<label htmlFor="description">Description</label>
|
|
<textarea
|
|
id="description"
|
|
value={description}
|
|
onChange={(e) => onDescriptionChange(e.target.value)}
|
|
placeholder="Optional description of your presentation"
|
|
className="form-textarea"
|
|
rows={3}
|
|
/>
|
|
</div>
|
|
</section>
|
|
);
|
|
}; |