components.templ RawHistoryFolder
1package systemviews
2
3templ appFrameComponent(page renderedPage, theme shellTheme, body templ.Component) {
4 <div class={ appRootClass(theme) } data-route={ string(page.route) } data-page-title={ pageDocumentTitle(page) }
5 if theme.InlineVars != "" {
6 style={ theme.InlineVars }
7 }
8 >
9 <div class="sv-shell">
10 if page.subtitle != "" {
11 <h1 class="sv-title">
12 { page.subtitle }
13 if page.subtitleDetail != "" {
14 <span class="sv-title-detail">{ page.subtitleDetail }</span>
15 }
16 </h1>
17 }
18 <div class="sv-content">
19 @body
20 </div>
21 </div>
22 </div>
23}
24
25templ Section(className string, title string) {
26 <section class={ sectionClass(className) }>
27 <h2>{ title }</h2>
28 { children... }
29 </section>
30}
31
32templ Meta(text string) {
33 <p class="sv-meta">{ text }</p>
34}
35
36templ EmptyState(message string) {
37 <div class="sv-empty"><p>{ message }</p></div>
38}
39
40templ LoadingPanel(message string) {
41 <div class="sv-loading-panel" role="status" aria-live="polite">
42 <span class="sv-spinner" aria-hidden="true"></span>
43 <span>{ message }</span>
44 </div>
45}
46
47templ LoadingCard(label string) {
48 <div class="sv-stat-card sv-loading-card" role="status" aria-live="polite">
49 <span class="sv-spinner" aria-hidden="true"></span>
50 <span class="sv-stat-label">{ label }</span>
51 </div>
52}
53
54templ Alert(kind string, message string) {
55 if message != "" {
56 <div class={ alertClass(kind) } role={ alertRole(kind) }>{ message }</div>
57 }
58}
59
60templ List() {
61 <ul class="sv-list">
62 { children... }
63 </ul>
64}
65
66templ ListRow() {
67 <li class="sv-list-row">
68 { children... }
69 </li>
70}
71
72templ Button(label string, action string, classes string, attrs templ.Attributes, disabled bool) {
73 <button type="button" class={ buttonClass(classes) } data-sv-action={ action } disabled?={ disabled } { attrs... }>{ label }</button>
74}
75
76templ KeyList(keys []string) {
77 if len(keys) == 0 {
78 <span class="sv-key sv-key-empty">Unassigned</span>
79 } else {
80 for _, key := range keys {
81 <span class="sv-key">{ key }</span>
82 }
83 }
84}
85
86templ KV(rows []kvPair) {
87 if len(rows) == 0 {
88 @EmptyState("No configuration details")
89 } else {
90 <dl class="sv-kv">
91 for _, row := range rows {
92 <div class="sv-kv-row"><dt>{ row.Label }</dt><dd>{ row.Value }</dd></div>
93 }
94 </dl>
95 }
96}