import React from 'react'; import { View, Text, Image, StyleSheet, Dimensions, TouchableOpacity } from 'react-native'; import { Slide } from '../../types/models'; import MaterialIcons from 'react-native-vector-icons/MaterialIcons'; import { useTheme } from '../ThemeProvider'; interface SlideViewProps { slide: Slide; showNotes?: boolean; isFullscreen?: boolean; onToggleFullscreen?: () => void; onNavigate?: (direction: 'prev' | 'next') => void; isFirstSlide?: boolean; isLastSlide?: boolean; } export const SlideView: React.FC = ({ slide, showNotes = false, isFullscreen = false, onToggleFullscreen, onNavigate, isFirstSlide = false, isLastSlide = false, }) => { const { theme } = useTheme(); return ( {slide.imageUrl && ( {/* Navigation Areas */} {!isFirstSlide && ( onNavigate?.('prev')} /> )} {!isLastSlide && ( onNavigate?.('next')} /> )} {/* Image */} {/* Navigation Indicators */} {isFullscreen && ( <> {!isFirstSlide && ( )} {!isLastSlide && ( )} )} )} {!isFullscreen && ( {slide.title} {slide.bulletPoints && slide.bulletPoints.length > 0 && ( {slide.bulletPoints.map((point, index) => ( {point} ))} )} {slide.fullText && ( {slide.fullText} )} {showNotes && slide.notes && ( Notes: {slide.notes} )} )} ); }; const { width, height } = Dimensions.get('window'); const ASPECT_RATIO = 16 / 9; const SLIDE_WIDTH = width; const SLIDE_HEIGHT = SLIDE_WIDTH / ASPECT_RATIO; const styles = StyleSheet.create({ container: { width: SLIDE_WIDTH, height: SLIDE_HEIGHT, borderRadius: 8, overflow: 'hidden', }, fullscreenContainer: { width: '100%', height: '100%', borderRadius: 0, }, imageContainer: { width: '100%', height: undefined, aspectRatio: 16 / 9, overflow: 'hidden', position: 'relative', }, fullscreenImageContainer: { width: '100%', height: '100%', aspectRatio: undefined, }, image: { width: '100%', height: '100%', position: 'absolute', }, navigationArea: { position: 'absolute', top: 0, left: 0, width: '50%', height: '100%', zIndex: 2, }, navigationAreaRight: { left: '50%', }, navigationIndicator: { position: 'absolute', top: '50%', transform: [{ translateY: -18 }], opacity: 0.5, zIndex: 1, }, navigationIndicatorLeft: { left: 16, }, navigationIndicatorRight: { right: 16, }, content: { padding: 16, flex: 1, }, contentTitle: { fontSize: 24, fontWeight: 'bold', marginBottom: 16, }, bulletPoints: { marginBottom: 16, }, bulletPoint: { flexDirection: 'row', marginBottom: 8, alignItems: 'flex-start', }, bullet: { fontSize: 16, marginRight: 8, }, bulletText: { fontSize: 16, flex: 1, }, fullText: { fontSize: 16, marginBottom: 16, }, notesContainer: { marginTop: 16, padding: 16, borderRadius: 8, }, notesTitle: { fontSize: 14, fontWeight: 'bold', marginBottom: 8, }, notes: { fontSize: 14, lineHeight: 20, }, });