import React from 'react'; // @ts-ignore - Peer dependency import { View, Text, Pressable, Image } from 'react-native'; // @ts-ignore - Peer dependency import { ScaledSheet } from 'react-native-size-matters'; import { COLORS } from '../../constants/colors'; import { PauseFilledIcon, PlayFilledIcon, TickThickIcon, CloseIcon, // @ts-ignore - Peer dependency } from '../../assets/icons/index.js'; interface TimelineHeaderProps { currentTime: number; videoDuration: number; isPlaying: boolean; isTrimming: boolean; onTogglePlayback: () => void; onConfirmTrim?: () => void; onCancelTrim?: () => void; onCloseTimeline: () => void; } const formatTime = (seconds: number): string => { const mins = Math.floor(seconds / 60); const secs = Math.floor(seconds % 60); return `${mins}:${secs.toString().padStart(2, '0')}`; }; export const TimelineHeader: React.FC = ({ currentTime, videoDuration, isPlaying, isTrimming, onTogglePlayback, onConfirmTrim, onCancelTrim, onCloseTimeline, }) => { return ( {formatTime(currentTime)} / {formatTime(videoDuration)} {isTrimming ? ( ) : ( )} ); }; const styles = ScaledSheet.create({ container: { flexDirection: 'row', alignItems: 'center', justifyContent: 'space-between', paddingHorizontal: '16@ms', marginBottom: '8@ms', backgroundColor: 'transparent', }, playPauseButton: { width: '32@ms', height: '32@ms', borderRadius: '16@ms', backgroundColor: 'rgba(255, 255, 255, 0.2)', alignItems: 'center', justifyContent: 'center', }, playPauseIcon: { width: '12@ms', height: '12@ms', tintColor: '#fff', resizeMode: 'contain', }, durationText: { fontSize: '13@ms', color: '#fff', fontWeight: '600', letterSpacing: '0.5@ms', }, durationSeparator: { color: 'rgba(255, 255, 255, 0.5)', fontWeight: '400', }, trimActionsContainer: { flexDirection: 'row', gap: '8@ms', }, trimButtonSmall: { width: '32@ms', height: '32@ms', borderRadius: '16@ms', backgroundColor: 'rgba(255, 255, 255, 0.2)', alignItems: 'center', justifyContent: 'center', }, trimIcon: { width: '14@ms', height: '14@ms', resizeMode: 'contain', }, trimCancleIcon: { width: '10@ms', height: '10@ms', resizeMode: 'contain', }, collapseButton: { width: '32@ms', height: '32@ms', borderRadius: '16@ms', backgroundColor: 'rgba(255, 255, 255, 0.2)', alignItems: 'center', justifyContent: 'center', }, collapseIcon: { fontSize: '14@ms', color: '#fff', fontWeight: '500', }, });