This commit is contained in:
mmrbnjd
2025-07-12 21:33:44 +03:30
parent d397f70b9a
commit 8a6ff3da67
32 changed files with 320 additions and 403 deletions

View File

@@ -1,30 +1,30 @@
@using Hushian.Application.Dtos
@using Common.Dtos.Conversation
@inject IJSRuntime JSRuntime
<div class="chat-container p-3">
@foreach (var msg in Messages)
{
@if (!target && ((!msg.IsRead && msg.Type == Hushian.Enums.ConversationType.UE) || Messages.Last() == msg))
@if (!target && ((!msg.IsRead && msg.Type == Common.Enums.ConversationType.UE) || Messages.Last() == msg))
{
target = true;
<div id="target" style="text-align: center;">
@if (!msg.IsRead && msg.Type == Hushian.Enums.ConversationType.UE)
@if (!msg.IsRead && msg.Type == Common.Enums.ConversationType.UE)
{
<p>ـــــــــــــــــــــــــ</p>
}
</div>
}
<div class="d-flex mb-2 @(msg.Type==Hushian.Enums.ConversationType.UE ? "justify-content-end" : "justify-content-start")" >
<div class="chat-bubble @(msg.Type==Hushian.Enums.ConversationType.UE ? "chat-mine"
: msg.Type==Hushian.Enums.ConversationType.UE && msg.ExperID=="bot" ? "chat-ai" : "chat-other")" data-id="@msg.ID">
<div class="d-flex mb-2 @(msg.Type==Common.Enums.ConversationType.UE ? "justify-content-end" : "justify-content-start")">
<div class="chat-bubble @(msg.Type==Common.Enums.ConversationType.UE ? "chat-mine"
: "chat-other")" data-id="@msg.ID">
@msg.text
</div>
@if (msg.Type == Hushian.Enums.ConversationType.EU)
@if (msg.Type == Common.Enums.ConversationType.EU)
{
if (msg.IsRead)
{
@@ -75,7 +75,7 @@
@code {
bool target = false;
[Parameter]
public List<ConversationItemDto> Messages { get; set; } = new();
public List<Read_ConversationResponseDto> Messages { get; set; } = new();
[Parameter] public EventCallback<int> EventCallIsRead { get; set; }
protected override async Task OnAfterRenderAsync(bool firstRender)
@@ -91,7 +91,7 @@
public async Task MarkAsRead(int id)
{
var msg = Messages.FirstOrDefault(m => m.ID == id);
if (msg != null && !msg.IsRead && msg.Type==Hushian.Enums.ConversationType.UE)
if (msg != null && !msg.IsRead && msg.Type==Common.Enums.ConversationType.UE)
{
msg.IsRead = true;
await EventCallIsRead.InvokeAsync(id);