@namespace AIStudio.Components
@inherits MSGComponentBase

@if (this.ShouldRenderVoiceRecording)
{
    <MudTooltip Text="@this.Tooltip">
        @if (this.isTranscribing || this.isPreparing)
        {
            <MudProgressCircular Size="Size.Small" Indeterminate="true" Color="Color.Primary"/>
        }
        else
        {
            <MudToggleIconButton Toggled="@this.isRecording"
                                 ToggledChanged="@this.OnRecordingToggled"
                                 Icon="@Icons.Material.Filled.Mic"
                                 ToggledIcon="@Icons.Material.Filled.Stop"
                                 Disabled="@(!this.IsVoiceRecordingAvailable)"
                                 Color="Color.Primary"
                                 ToggledColor="Color.Error"/>
        }
    </MudTooltip>
}
