Nice little directory browser :D
1<a id="go-back"
2 class="clickable"
3 href="@(_isAtRoot ? null : "..")"
4 aria-label="Go up 1 directory"
5 hx-boost="true"
6 aria-disabled="@(_isAtRoot ? "true" : "false")"
7 tabindex="@(_isAtRoot ? -1 : 0)"
8 onClick="@(_isAtRoot ? "event.preventDefault();" : null)"
9 @attributes="AdditionalAttributes"
10>
11 <span class="cursor-default! [vertical-align:sub]">../</span>
12</a>
13<button>hi</button>
14
15@code {
16 [Parameter]
17 public required String Path { get; set; }
18
19 [Parameter(CaptureUnmatchedValues = true)]
20 public IDictionary<String, Object>? AdditionalAttributes { get; set; }
21
22 private bool _isAtRoot;
23
24 protected override Task OnInitializedAsync() {
25 _isAtRoot = Path == "/";
26
27 return base.OnInitializedAsync();
28 }
29}