import React from 'react' ; import ProgressBar from './ProgressBar' ; export default { title : 'Teleport/Player/ProgressBar' , } ; export const Playing = ( ) => { const [ state , setState ] = React . useState ( ( ) => ( { isPlaying : true , current : 100 , min : 1 , max : 200 , value : 1 , time : '12:12' , } ) ) ; function move ( current ) { setState ( { ... state , current : current , } ) ; } function toggle ( ) { setState ( { ... state , isPlaying : ! state . isPlaying , } ) ; } const props = { ... state , move , toggle , } ; return < ProgressBar { ... props } / > ; } ;