import { StyleSheet, type StyleProp, type ViewStyle } from 'react-native'; import { usePlayback } from '../../hooks'; import { Pause, Play } from '../svgs'; import { BaseIconButton } from '../common'; export interface PlayButtonProps { size?: number; color?: string; style?: StyleProp; renderPlayIcon?: () => React.ReactNode; renderPauseIcon?: () => React.ReactNode; } /** * A button that plays and pauses the video. * * @param {PlayButtonProps} props - The props for the component. * @returns {React.ReactElement} - The play button component. */ export const PlayButton = ({ size, color, style, renderPlayIcon, renderPauseIcon, }: PlayButtonProps): React.ReactElement => { const { isPlaying, togglePlayPause } = usePlayback(); const PlayIcon = renderPlayIcon || Play; const PauseIcon = renderPauseIcon || Pause; return ( ); }; const styles = StyleSheet.create({ playButton: { alignItems: 'center', justifyContent: 'center', backgroundColor: 'transparent', }, });