@using Common.Dtos.Conversation

@if (SelectedConversationItems!=null)
{
    @foreach (var item in SelectedConversationItems)
    {
        if (item.Type == Common.Enums.ConversationType.UE)
        {
            <div style="display: flex; "
            dir="rtl" class="p-1 rounded w-100">
                <div class="bg-green-100 border p-2 rounded text-end" dir="rtl">
                    @item.text
                </div>
                <Icon Style="align-self: self-end;" Name="IconName.CheckLg" Size="IconSize.x5" />

            </div>
        }
        else
        {
            <div id="target" style="text-align: center;">
                @if (!target&& !item.IsRead)
                {
                    target = true;
                    <p>ـــــــــــــــــــــــــ</p>
                }

            </div>
            <div style="display: flex; "
            dir="ltr" class="p-1 rounded w-100">
                <div class="bg-white border p-3 rounded text-end" dir="rtl">
                    @item.text
                </div>
                <Icon Style="align-self: self-end;" Name="IconName.CheckLg" Size="IconSize.x5" />

            </div>
        }
    }

}





@code {
    bool target = false;
    //  [Parameter] public List<Read_ConversationDto> Conversations { get; set; }
    [Parameter] public List<Read_ConversationResponseDto> SelectedConversationItems { get; set; }
    protected override Task OnParametersSetAsync()
    {
        target = false;
        return base.OnParametersSetAsync();
    }
}
