// Movie poster card — 2:3 aspect poster + title + year/studio meta. // Współdzielona przez MoviesScreen (grid) i PerformerScenes (Movies tab). import { Image } from 'expo-image'; import React from 'react'; import { Pressable, StyleSheet, Text, View } from 'react-native'; import { fonts, theme } from '../theme'; import type { MovieOut } from '../types'; export function MoviePosterCard({ movie, isNew = false, onPress, }: { movie: MovieOut; isNew?: boolean; onPress: () => void; }) { const studio = movie.studio?.name; // Watched indicator (parytet ze ScenesScreen): finished=true → dim posteru + // ✓ badge w prawym górnym. Pośredni progress bez dim'a (user może wrócić). // bug-report b207ff17 2026-05-26. const dim = movie.finished === true; const progressPct = !dim && movie.position_sec && movie.duration_sec && movie.duration_sec > 0 ? Math.min(100, Math.round((movie.position_sec / movie.duration_sec) * 100)) : 0; return ( {movie.poster_url ? ( ) : ( {movie.title} )} {movie.rating != null ? ( {movie.rating.toFixed(1)} ) : null} {isNew ? ( NEW ) : null} {dim ? ( ) : null} {progressPct > 0 ? ( ) : null} {movie.title} {movie.release_year ?? '—'} {studio ? ` · ${studio}` : ''} ); } const styles = StyleSheet.create({ card: { flex: 1, marginBottom: 14 }, posterWrap: { aspectRatio: 2 / 3, backgroundColor: theme.card, borderRadius: 10, overflow: 'hidden', position: 'relative', }, poster: { width: '100%', height: '100%' }, posterPlaceholder: { alignItems: 'center', justifyContent: 'center', padding: 12 }, posterPlaceholderText: { color: theme.muted, fontSize: 12, textAlign: 'center' }, ratingBadge: { position: 'absolute', top: 8, right: 8, backgroundColor: 'rgba(0,0,0,0.7)', borderRadius: 6, paddingHorizontal: 6, paddingVertical: 2, }, ratingText: { color: theme.fg, fontSize: 11, fontWeight: '700' }, newBadge: { position: 'absolute', top: 8, left: 8, backgroundColor: theme.accent, borderRadius: 4, paddingHorizontal: 6, paddingVertical: 2, }, newBadgeText: { color: theme.fg, fontSize: 9, fontFamily: fonts.mono, fontWeight: '700', letterSpacing: 0.6 }, posterDimmed: { opacity: 0.45 }, watchedBadge: { position: 'absolute', bottom: 8, right: 8, backgroundColor: 'rgba(0,0,0,0.7)', borderRadius: 999, width: 22, height: 22, alignItems: 'center', justifyContent: 'center', }, watchedBadgeText: { color: theme.fg, fontSize: 12, fontWeight: '700' }, progressBg: { position: 'absolute', left: 0, right: 0, bottom: 0, height: 3, backgroundColor: 'rgba(0,0,0,0.5)', }, progressFg: { height: 3, backgroundColor: theme.accent }, title: { color: theme.fg, fontSize: 13, fontFamily: fonts.display, marginTop: 6, letterSpacing: -0.2 }, titleDimmed: { color: theme.muted }, meta: { color: theme.muted, fontSize: 10, fontFamily: fonts.mono, marginTop: 2, letterSpacing: 0.5, textTransform: 'uppercase' }, });