blob: 2ad23397a7dec2ffd5f8ee4902daae1997f3f69c (
plain) (
blame)
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
38
39
40
41
42
|
import React from 'react';
function Control({
onPlay,
onPause,
onReset,
current,
setCurrent,
recoverAutoScrollImmediately,
}: {
onPlay: () => void;
onPause: () => void;
onReset: () => void;
current: number;
setCurrent: (c: number) => void;
recoverAutoScrollImmediately: () => void;
}) {
return (
<div className="flex items-center space-x-2 p-2 bg-gray-200">
<button type="button" onClick={onPlay} className="btn">
play
</button>
<button type="button" onClick={onPause} className="btn">
pause
</button>
<button type="button" onClick={onReset} className="btn">
reset
</button>
<input
type="number"
value={current}
onChange={(event) => setCurrent(Number(event.target.value))}
className="input"
/>
<button type="button" onClick={recoverAutoScrollImmediately} className="btn">
recover auto scroll immediately
</button>
</div>
);
}
export default Control;
|