File size: 905 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React, { memo, FC } from 'react';
import Broadcast from '@/components/svgIcon';
import './index.scss';

export interface MonitorType {
  isPlay: boolean;
  handleChangePlayState: React.MouseEventHandler<SVGSVGElement>;
  currentTime: string;
  totalTime: string;
}

const Monitor: FC<MonitorType> = memo(function Monitor({
  isPlay,
  handleChangePlayState,
  currentTime,
  totalTime,
}) {
  return (
    <div className="play-pause-timeline">
      <Broadcast
        iconClass={!isPlay ? 'player' : 'pause'}
        fill="#fff"
        fontSize="20px"
        onClick={handleChangePlayState}
        className="icon"
      />
      <span className="time-wrap">
        <span className="current-time">{currentTime}</span>
        <span className="time-divider">&nbsp;/&nbsp;</span>
        <span className="total-time">{totalTime}</span>
      </span>
    </div>
  );
});

export default Monitor;