RecordingLength.tsx 607 B

12345678910111213141516171819202122232425
  1. import type { I18n } from '@uppy/utils/lib/Translator'
  2. import { h } from 'preact'
  3. import formatSeconds from './formatSeconds.ts'
  4. interface RecordingLengthProps {
  5. recordingLengthSeconds: number
  6. i18n: I18n
  7. }
  8. export default function RecordingLength({
  9. recordingLengthSeconds,
  10. i18n,
  11. }: RecordingLengthProps): JSX.Element {
  12. const formattedRecordingLengthSeconds = formatSeconds(recordingLengthSeconds)
  13. return (
  14. <span
  15. aria-label={i18n('recordingLength', {
  16. recording_length: formattedRecordingLengthSeconds,
  17. })}
  18. >
  19. {formattedRecordingLengthSeconds}
  20. </span>
  21. )
  22. }