19
common/resources/client/player/ui/controls/formatted-current-time.tsx
Executable file
19
common/resources/client/player/ui/controls/formatted-current-time.tsx
Executable file
@@ -0,0 +1,19 @@
|
||||
import {useCurrentTime} from '@common/player/hooks/use-current-time';
|
||||
import {FormattedDuration} from '@common/i18n/formatted-duration';
|
||||
import {usePlayerStore} from '@common/player/hooks/use-player-store';
|
||||
|
||||
interface Props {
|
||||
className?: string;
|
||||
}
|
||||
export function FormattedCurrentTime({className}: Props) {
|
||||
const duration = usePlayerStore(s => s.mediaDuration);
|
||||
const currentTime = useCurrentTime();
|
||||
return (
|
||||
<span className={className}>
|
||||
<FormattedDuration
|
||||
seconds={currentTime}
|
||||
addZeroToFirstUnit={duration >= 600}
|
||||
/>
|
||||
</span>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user