AI-Studio/app/MindWork AI Studio/Components/SelectDirectory.razor

38 lines
1.2 KiB
Plaintext
Raw Normal View History

@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 folder 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.Directory"
Label="@this.Label"
ReadOnly="@true"
Validation="@this.Validation"
Adornment="Adornment.Start"
AdornmentIcon="@Icons.Material.Filled.Folder"
UserAttributes="@SPELLCHECK_ATTRIBUTES"
Variant="Variant.Outlined"
/>
<MudButton StartIcon="@Icons.Material.Filled.FolderOpen" Variant="Variant.Outlined" Color="Color.Primary" Disabled="@(this.Disabled || this.isDirectoryDialogOpen)" OnClick="@this.OpenDirectoryDialog">
@T("Choose Directory")
</MudButton>
</MudStack>;
}