azure-ai/AzureAi.Transcriber/Components/Pages/Home.razor

51 lines
1.1 KiB
Text
Raw Normal View History

@page "/"
2024-05-08 10:14:30 +00:00
@inherits HomeBase
@rendermode InteractiveServer
<PageTitle>Home</PageTitle>
2024-05-08 10:14:30 +00:00
<div id="file-selection">
@if (string.IsNullOrWhiteSpace(SelectedFile))
{
<p>No file selected</p>
}
else
{
<p>@SelectedFile.Split("/").LastOrDefault()</p>
}
2024-05-08 10:14:30 +00:00
<h3>Available files</h3>
<ul class="@(TranscribeInProgress ? "transcribing" : "")">
@foreach (var file in Files)
{
<li class="@(SelectedFile == file ? "selected" : "")" @onclick="() => SelectFile(file)">
@file.Split("/").LastOrDefault()
</li>
}
</ul>
<button @onclick="Transcribe" disabled="@TranscribeInProgress">
@if (TranscribeInProgress)
{
<span>Transcribing...</span>
}
else
{
<span>Transcribe</span>
}
</button>
</div>
<div id="results">
<h3>Transcription</h3>
@if (string.IsNullOrWhiteSpace(Transcription))
{
<p>No transcription results</p>
}
else
{
<div id="transcription">@Transcription</div>
}
</div>