{{define "inbox"}} {{if .Contact}}
{{if .TestCampaign}}{{$.I18n.T "← Campaign"}}{{else}}{{$.I18n.T "← Inbox"}}{{end}}

{{.Contact.Name}}

{{$.I18n.T "Details"}}
{{template "messages" .}}
{{if .Contact.LiveInstagram}}
{{end}}
{{else}}
{{template "desk-hero" .}}{{template "conversation-list" .}}
{{end}} {{end}} {{define "messages"}}
{{range .Messages}}
{{if eq .Channel "instagram"}}{{if eq .Direction "outbound"}} {{else}} {{end}}{{end}}
{{with messageBody .}}

{{.Text}}{{if .Link}}{{.Link}}{{end}}

{{end}}

{{$.I18n.T (channelName .Channel)}}{{if or (eq .Status "meta_uncertain") (eq .Status "meta_failed") (eq .Status "telegram_uncertain") (eq .Status "telegram_failed") (eq .Status "queued") (eq .Status "suppressed")}}{{$.I18n.T (status .Status)}}{{else if or (eq .Status "simulated_sent") (eq .Status "simulated_received")}} {{$.I18n.T "· simulated"}}{{end}}

{{else}}

{{$.I18n.T "No messages yet."}}

{{end}}
{{end}} {{define "conversation-list"}}
{{range .Contacts}}
{{.Name}}

{{if .LastBody}}{{short .LastBody}}{{else}}{{$.I18n.T "No messages yet"}}{{end}}

{{else}}

{{$.I18n.T "Your Instagram conversations will appear here."}} {{$.I18n.T "Test a campaign DM"}}.

{{end}}
{{end}}