@model LittleShop.DTOs.MessageThreadDto @{ ViewData["Title"] = $"Conversation with {Model.CustomerName}"; } @{ // Get customer info if name is not loaded if (Model.CustomerName == "Loading...") { // This would need to be loaded via a service call Model.CustomerName = "Customer"; // Fallback } }

Conversation with @Model.CustomerName

Back to Messages
@if (TempData["Success"] != null) { } @if (TempData["Error"] != null) { }
Conversation with @Model.CustomerName
@Model.MessageCount messages since @Model.StartedAt.ToString("MMM dd, yyyy")
@if (!Model.Messages.Any()) {
No messages yet

This is the start of your conversation with @Model.CustomerName.

Send a message below to begin the conversation.

} else { @foreach (var message in Model.Messages.OrderBy(m => m.CreatedAt)) {
@if (message.Direction == 0) { @:Admin } else { @Model.CustomerName } @message.CreatedAt.ToString("MMM dd, HH:mm")
@Html.Raw(message.Content.Replace("\n", "
"))
@if (!string.IsNullOrEmpty(message.OrderReference)) { } @if (message.IsUrgent) { Urgent }
} }
Customer Information

Name: @Model.CustomerName

Messages: @Model.MessageCount

First Contact: @Model.StartedAt.ToString("MMM dd, yyyy HH:mm")

Last Message: @Model.LastMessageAt.ToString("MMM dd, yyyy HH:mm")

@if (Model.HasUnreadMessages) {
Has unread messages
} @if (Model.RequiresResponse) {
Requires response
}
@(Model.MessageCount == 0 ? "Start Conversation" : "Send Reply")