2024-01-15 22:26:51 +00:00
|
|
|
package html
|
|
|
|
|
|
|
|
import "fmt"
|
|
|
|
|
|
|
|
type RepoHeaderComponentContext struct {
|
|
|
|
Name string
|
|
|
|
Ref string
|
|
|
|
Description string
|
|
|
|
}
|
|
|
|
|
|
|
|
templ repoHeaderComponent(rhcc RepoHeaderComponentContext) {
|
2024-01-16 03:11:52 +00:00
|
|
|
<div class="mb-1 text-text">
|
|
|
|
<a class="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>
|
|
|
|
}
|
|
|
|
{ " - " }
|
|
|
|
<a class="underline decoration-text/50 decoration-dashed hover:decoration-solid" href={ templ.SafeURL(fmt.Sprintf("/%s/refs", rhcc.Name)) }>Refs</a>
|
|
|
|
{ " - " }
|
|
|
|
<a class="underline decoration-text/50 decoration-dashed hover:decoration-solid" href={ templ.SafeURL(fmt.Sprintf("/%s/log/%s", rhcc.Name, rhcc.Ref)) }>Log</a>
|
|
|
|
</div>
|
2024-01-15 22:26:51 +00:00
|
|
|
<div class="text-text/80 mb-1">{ rhcc.Description }</div>
|
|
|
|
}
|
|
|
|
|