Files
mtdb_movie/common/resources/client/player/ui/controls/formatted-current-time.tsx
maher 703f50a09d
Some checks failed
Build / run (push) Has been cancelled
first commit
2025-10-29 11:42:25 +01:00

20 lines
578 B
TypeScript
Executable File

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>
);
}