mirror of
https://github.com/lantean-code/qbtmud.git
synced 2025-10-23 04:52:22 +00:00
28 lines
643 B
C#
28 lines
643 B
C#
using Lantean.QBTMudBlade.Models;
|
|
using Microsoft.AspNetCore.Components;
|
|
|
|
namespace Lantean.QBTMudBlade.Components
|
|
{
|
|
public partial class TorrentInfo
|
|
{
|
|
[Parameter]
|
|
[EditorRequired]
|
|
public string Hash { get; set; } = default!;
|
|
|
|
[CascadingParameter]
|
|
public MainData MainData { get; set; } = default!;
|
|
|
|
protected Torrent? Torrent => GetTorrent();
|
|
|
|
private Torrent? GetTorrent()
|
|
{
|
|
if (Hash is null || !MainData.Torrents.TryGetValue(Hash, out var torrent))
|
|
{
|
|
return null;
|
|
}
|
|
|
|
return torrent;
|
|
}
|
|
}
|
|
}
|