{{define "header"}}
<header class="heading">

{{if .Letterhead}}
<img src="data:image/png;base64,{{.Letterhead}}" />
{{end}}

<div>
<div class="user-info">
<h4>{{.User.FirstName}} {{.User.LastName}}</h4>
<span>{{.User.Email}}</span>
<span>{{.User.Phone}}</span>
<small>{{.User.Address.Street}}</small>
<small>
{{.User.Address.City}}, {{.User.Address.Region}} {{.User.Address.Zip}}
</small>
</div>
{{if .Avatar}}
<img src="data:image/png;base64,{{.Avatar}}" />
{{end}}
</div>

</header>

<style scoped>
h4 {
    margin: 4px 0;
}

header.heading > div {
    display: flex;
    text-align: right;
    margin-left: auto;
}

header.heading .user-info {
  margin-right: 8px;
}


header.heading {
    display: flex;
    justify-content: space-between;
}

.user-info {
    display: flex;
    flex-flow: column;
}
</style>
{{end}}
