slideshare/src/components/presentations/shared/SlideThumbnail.tsx
Michael Mainguy 1008bd4bca Implement slide preview and fix import standards project-wide
## New Feature: Full Screen Slide Preview
- Add SlidePreviewModal component for full screen slide preview in SlideEditor
- ESC key support and temporary hint for user guidance
- Proper aspect ratio handling with theme CSS inheritance
- Modal follows existing UI patterns for consistency

## Import Standards Compliance (31 files updated)
- Fix all imports to use explicit .tsx/.ts extensions per IMPORT_STANDARDS.md
- Eliminate barrel imports in App.tsx for better Vite tree shaking
- Add direct imports with explicit paths across entire codebase
- Preserve CSS imports and external library imports unchanged

## Code Architecture Improvements
- Add comprehensive CSS & Component Architecture Guidelines to CLAUDE.md
- Document modal patterns, aspect ratio handling, and CSS reuse principles
- Reference all coding standards files for consistent development workflow
- Prevent future CSS overcomplication and component duplication

## Performance Optimizations
- Enable Vite tree shaking with proper import structure
- Improve module resolution speed with explicit extensions
- Optimize build performance through direct imports

## Files Changed
- 31 TypeScript/React files with import fixes
- 2 new SlidePreviewModal files (component + CSS)
- Updated project documentation and coding guidelines
- Fixed aspect ratio CSS patterns across components

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-21 06:52:56 -05:00

83 lines
1.9 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import React from 'react';
import type { Slide } from '../../../types/presentation.ts';
import './SlideThumbnail.css';
interface SlideThumbnailProps {
slide: Slide;
index: number;
isActive: boolean;
isDisabled?: boolean;
onClick: () => void;
onDoubleClick?: () => void;
onEdit: () => void;
onDuplicate: () => void;
onDelete: () => void;
}
export const SlideThumbnail: React.FC<SlideThumbnailProps> = ({
slide,
index,
isActive,
isDisabled = false,
onClick,
onDoubleClick,
onEdit,
onDuplicate,
onDelete
}) => {
return (
<div
className={`slide-thumbnail ${isActive ? 'active' : ''}`}
onClick={onClick}
onDoubleClick={onDoubleClick}
>
<div className="thumbnail-number">{index + 1}</div>
<div className="thumbnail-preview">
<div className="thumbnail-content">
<span className="layout-name">{slide.layoutId}</span>
<span className="content-count">
{Object.keys(slide.content).length} items
</span>
</div>
</div>
<div className="thumbnail-actions">
<button
type="button"
className="thumbnail-action edit"
onClick={(e) => {
e.stopPropagation();
onEdit();
}}
title="Edit slide content"
disabled={isDisabled}
>
</button>
<button
type="button"
className="thumbnail-action"
onClick={(e) => {
e.stopPropagation();
onDuplicate();
}}
title="Duplicate slide"
disabled={isDisabled}
>
</button>
<button
type="button"
className="thumbnail-action delete"
onClick={(e) => {
e.stopPropagation();
onDelete();
}}
title="Delete slide"
disabled={isDisabled}
>
</button>
</div>
</div>
);
};