mirror of https://git.jolheiser.com/ugit.git
24 lines
700 B
Plaintext
24 lines
700 B
Plaintext
package html
|
|
|
|
import "fmt"
|
|
|
|
type RepoHeaderComponentContext struct {
|
|
Name string
|
|
Ref string
|
|
Description string
|
|
}
|
|
|
|
templ repoHeaderComponent(rhcc RepoHeaderComponentContext) {
|
|
if rhcc.Name != "" {
|
|
<div class="mb-1">
|
|
<a class="text-text text-lg underline decoration-text/50 decoration-dashed hover:decoration-solid" href={ templ.SafeURL("/" + rhcc.Name) }>{ rhcc.Name }</a>
|
|
if rhcc.Ref != "" {
|
|
{ " " }
|
|
<a class="text-text/70 text-sm underline decoration-text/50 decoration-dashed hover:decoration-solid" href={ templ.SafeURL(fmt.Sprintf("/%s/tree/%s/", rhcc.Name, rhcc.Ref)) }>{ "@" + rhcc.Ref }</a>
|
|
}
|
|
</div>
|
|
}
|
|
<div class="text-text/80 mb-1">{ rhcc.Description }</div>
|
|
}
|
|
|