LANCommander/LANCommander.UI/Components/Chat/ChatList.razor
2025-11-11 01:10:05 -06:00

19 lines
No EOL
691 B
Text

@namespace LANCommander.UI.Components
<DataList DataSource="Threads">
<ChatListThread Thread="context" OnSelected="SelectThread" Active="@(SelectedThread?.Id == context.Id)" />
</DataList>
@code {
[Parameter] public required IEnumerable<SDK.Models.ChatThread> Threads { get; set; } = [];
[Parameter] public SDK.Models.ChatThread? SelectedThread { get; set; }
[Parameter] public EventCallback<SDK.Models.ChatThread> SelectedThreadChanged { get; set; }
async Task SelectThread(SDK.Models.ChatThread thread)
{
SelectedThread = thread;
if (SelectedThreadChanged.HasDelegate)
await SelectedThreadChanged.InvokeAsync(SelectedThread);
}
}