2026-10-26 10:00:01 +01:00
@inherits MSGComponentBase
@*
The tooltips of the buttons which open something show on hover only: the focus comes back to the
button from the program, the browser, or the file manager it opened, and a tooltip shown on focus
would then stay until the user clicks somewhere else.
*@
@switch (this.kind)
{
case FileActionsKind.WEB_PAGE:
@if (this.ShowCopy)
{
<MudTooltip Text="@string.Format(T("Copy the address: {0}"), this.Path)" Placement="@this.TooltipPlacement">
2026-11-11 14:20:49 +01:00
<MudIconButton Icon="@AppIcons.COPY" Size="Size.Small" Class="icon-button-compact" OnClick="@this.CopyPath"/>
2026-10-26 10:00:01 +01:00
</MudTooltip>
}
@if (this.ShowOpen)
{
<MudTooltip Text="@T("Open this web page in your browser")" Placement="@this.TooltipPlacement" ShowOnFocus="@false">
2026-11-11 14:20:49 +01:00
<MudIconButton Icon="@AppIcons.OPEN_EXTERNAL" Size="Size.Small" Class="icon-button-compact" Href="@this.Path" Target="_blank"/>
2026-10-26 10:00:01 +01:00
</MudTooltip>
}
break;
case FileActionsKind.FILE:
@if (this.ShowCopy)
{
<MudTooltip Text="@string.Format(T("Copy the path: {0}"), this.Path)" Placement="@this.TooltipPlacement">
2026-11-11 14:20:49 +01:00
<MudIconButton Icon="@AppIcons.COPY" Size="Size.Small" Class="icon-button-compact" OnClick="@this.CopyPath"/>
2026-10-26 10:00:01 +01:00
</MudTooltip>
}
@if (this.isMissing)
{
@* Instead of buttons which would only fail, and only where there would have been one: *@
@if (this.WarnIfMissing && (this.ShowFileManager || this.ShowOpen))
{
@* Not necessarily gone: the server of an ERI data source may name a file of its own, which was never on this computer. *@
<MudTooltip Text="@string.Format(T("AI Studio cannot find the file {0} on this computer. It may have been moved, renamed, or deleted, or it is on another computer, such as the server of a data source."), this.Path)" Placement="@this.TooltipPlacement">
2026-11-11 14:20:49 +01:00
<MudIcon Icon="@AppIcons.WARNING" Color="Color.Warning" Size="Size.Small" Class="file-action-warning"/>
2026-10-26 10:00:01 +01:00
</MudTooltip>
}
}
else
{
@if (this.ShowFileManager)
{
<MudTooltip Text="@T("Show this file in the file manager of your system")" Placement="@this.TooltipPlacement" ShowOnFocus="@false">
2026-11-11 14:20:49 +01:00
<MudIconButton Icon="@AppIcons.FOLDER_OPEN" Size="Size.Small" Class="icon-button-compact" OnClick="@this.ShowInFileManager"/>
2026-10-26 10:00:01 +01:00
</MudTooltip>
}
@if (this.ShowOpen)
{
<MudTooltip Text="@GetOpenTooltip(this.PageNumber)" Placement="@this.TooltipPlacement" ShowOnFocus="@false">
2026-11-11 14:20:49 +01:00
<MudIconButton Icon="@AppIcons.OPEN_EXTERNAL" Size="Size.Small" Class="icon-button-compact" OnClick="@this.Open"/>
2026-10-26 10:00:01 +01:00
</MudTooltip>
}
}
break;
}