/** * External dependencies */ import { AudioDurationDisplay } from '@automattic/jetpack-ai-client'; import { __ } from '@wordpress/i18n'; /** * Internal dependencies */ import Oscilloscope from './oscilloscope'; /** * Types */ import type { TranscriptionState } from '@automattic/jetpack-ai-client'; export default function AudioStatusPanel( { state, error = null, analyser, duration = 0, }: { state: TranscriptionState; error: string; analyser: AnalyserNode; duration: number; } ) { if ( state === 'inactive' ) { return (
{ __( 'File size limit: 25MB. Recording time limit: 25 minutes.', 'jetpack' ) }
); } if ( state === 'recording' ) { return (
{ __( 'Recording…', 'jetpack' ) }
); } if ( state === 'paused' ) { return (
{ __( 'Paused', 'jetpack' ) }
); } if ( state === 'processing' ) { return (
{ __( 'Uploading and transcribing audio…', 'jetpack' ) }
); } if ( state === 'validating' ) { return (
{ __( 'Validating audio…', 'jetpack' ) }
); } if ( state === 'error' ) { return
{ error }
; } return null; }