working email headers display

This commit is contained in:
Tim Bendt
2025-05-01 12:31:10 -04:00
parent 1f75a03553
commit 0c756b55e9
4 changed files with 18 additions and 5 deletions

View File

@@ -8,16 +8,19 @@ class EnvelopeHeader(Static):
from_ = Reactive("")
to = Reactive("")
date = Reactive("")
cc = Reactive("")
bcc = Reactive("")
"""Header for the email viewer."""
def on_mount(self) -> None:
"""Mount the header."""
def render(self) -> RenderResult:
return f"[b][dim]Subject:[/dim] {self.subject}[/] \r\n" \
f"[dim]From:[/dim] {self.from_} \r\n" \
f"[dim]To:[/dim] {self.to} \r\n" \
f"[dim]Date:[/dim] {self.date}"
return f"[b]{self.subject}[/b] [dim]({self.date})[/] \r\n" \
f"[dim]From:[/dim] {self.from_} [dim]To:[/dim] {self.to} \r\n" \
f"[dim]Date:[/dim] {self.date} \r\n" \
f"[dim]CC:[/dim] {self.cc} \r\n" \
f"[dim]BCC:[/dim] {self.bcc} \r\n" \