import { Component, ReactNode } from 'react';
import * as React from 'react';
import videojs from 'video.js';

interface IVideoPlayerInfoProps {
    title: string;
    displayTime: boolean;
    currentTime: string;
    currentDuration: string;
    vjsComponent: videojs.Component;
}

export class VideoPlayerInfo extends Component<IVideoPlayerInfoProps, {}> {
    public render(): ReactNode {
        return (
            <div className='ns-video-top'>
                {this.props.title &&
                    <div className='ns-video-title'>
                        <h2>{this.props.title}</h2>
                    </div>
                }
                {this.props.displayTime &&
                    <div className='ns-video-timestamp'>
                        <h2>{(this.props.currentTime ? this.props.currentTime : '--:--') + ' / ' + this.props.currentDuration}</h2>
                    </div>
                }
            </div>
        );
    }
}