mirror of
https://github.com/MindWorkAI/AI-Studio.git
synced 2026-09-13 17:13:38 +00:00
38 lines
1.2 KiB
Plaintext
38 lines
1.2 KiB
Plaintext
@inherits MSGComponentBase
|
|
|
|
@if (this.EnableDragDrop)
|
|
{
|
|
<PathDropZone CatchAllDocuments="@this.CatchAllDocuments" Disabled="@(() => this.Disabled)" OnPathsDropped="@this.PathsDropped">
|
|
@this.Picker
|
|
<MudText Typo="Typo.body2">
|
|
@T("You can also drag & drop the file here.")
|
|
</MudText>
|
|
</PathDropZone>
|
|
}
|
|
else
|
|
{
|
|
@this.Picker
|
|
}
|
|
|
|
@code {
|
|
|
|
private RenderFragment Picker =>
|
|
@<MudStack Row="@true" Spacing="3" Class="mb-3" StretchItems="StretchItems.None" AlignItems="AlignItems.Center">
|
|
<MudTextField
|
|
T="string"
|
|
Text="@this.File"
|
|
Label="@this.Label"
|
|
ReadOnly="@true"
|
|
Validation="@this.Validation"
|
|
Adornment="Adornment.Start"
|
|
AdornmentIcon="@Icons.Material.Filled.AttachFile"
|
|
UserAttributes="@SPELLCHECK_ATTRIBUTES"
|
|
Variant="Variant.Outlined"
|
|
/>
|
|
|
|
<MudButton StartIcon="@Icons.Material.Filled.FolderOpen" Variant="Variant.Outlined" Color="Color.Primary" Disabled="@(this.Disabled || this.isFileDialogOpen)" OnClick="@this.OpenFileDialog">
|
|
@T("Choose File")
|
|
</MudButton>
|
|
</MudStack>;
|
|
}
|