summaryrefslogtreecommitdiffhomepage
path: root/src/features/computer/ui/ComputerSelect.svelte
diff options
context:
space:
mode:
authorAdam Malczewski <[email protected]>2026-06-26 22:21:55 +0900
committerAdam Malczewski <[email protected]>2026-06-26 22:23:39 +0900
commitc333fcec32b1f90bf0da6bb14d2609c20e38a74f (patch)
tree0db3ec77a6838c4f800c362df0de3c6cd8544431 /src/features/computer/ui/ComputerSelect.svelte
parent1285564f12238b22f6b39b9f3fbcecaca8456911 (diff)
downloaddispatch-web-c333fcec32b1f90bf0da6bb14d2609c20e38a74f.tar.gz
dispatch-web-c333fcec32b1f90bf0da6bb14d2609c20e38a74f.zip
style: switch from tabs to 2-space indentation (incl. svelte)
Diffstat (limited to 'src/features/computer/ui/ComputerSelect.svelte')
-rw-r--r--src/features/computer/ui/ComputerSelect.svelte60
1 files changed, 30 insertions, 30 deletions
diff --git a/src/features/computer/ui/ComputerSelect.svelte b/src/features/computer/ui/ComputerSelect.svelte
index d693140..c580b60 100644
--- a/src/features/computer/ui/ComputerSelect.svelte
+++ b/src/features/computer/ui/ComputerSelect.svelte
@@ -1,39 +1,39 @@
<script lang="ts">
- import type { ComputerEntry } from "@dispatch/wire";
+ import type { ComputerEntry } from "@dispatch/wire";
- let {
- value,
- computers,
- disabled = false,
- onSelect,
- }: {
- /** The currently selected computer alias, or null for "Local (none)". */
- value: string | null;
- /** Discovered computers from `GET /computers` (read-only). */
- computers: readonly ComputerEntry[];
- disabled?: boolean;
- onSelect: (computerId: string | null) => void;
- } = $props();
+ let {
+ value,
+ computers,
+ disabled = false,
+ onSelect,
+ }: {
+ /** The currently selected computer alias, or null for "Local (none)". */
+ value: string | null;
+ /** Discovered computers from `GET /computers` (read-only). */
+ computers: readonly ComputerEntry[];
+ disabled?: boolean;
+ onSelect: (computerId: string | null) => void;
+ } = $props();
- // A `<select>` value is a string; map "" ↔ null (Local). The chosen option's
- // value is the alias, with "" meaning "clear / local".
- const selectValue = $derived(value ?? "");
+ // A `<select>` value is a string; map "" ↔ null (Local). The chosen option's
+ // value is the alias, with "" meaning "clear / local".
+ const selectValue = $derived(value ?? "");
- function onChange(e: Event) {
- const v = (e.currentTarget as HTMLSelectElement).value;
- onSelect(v === "" ? null : v);
- }
+ function onChange(e: Event) {
+ const v = (e.currentTarget as HTMLSelectElement).value;
+ onSelect(v === "" ? null : v);
+ }
</script>
<select
- class="select select-bordered select-sm w-full font-mono text-xs"
- value={selectValue}
- disabled={disabled}
- onchange={onChange}
- aria-label="Computer"
+ class="select select-bordered select-sm w-full font-mono text-xs"
+ value={selectValue}
+ {disabled}
+ onchange={onChange}
+ aria-label="Computer"
>
- <option value="">Local (none)</option>
- {#each computers as c (c.alias)}
- <option value={c.alias}>{c.alias}{c.knownHost ? "" : " · new host"}</option>
- {/each}
+ <option value="">Local (none)</option>
+ {#each computers as c (c.alias)}
+ <option value={c.alias}>{c.alias}{c.knownHost ? "" : " · new host"}</option>
+ {/each}
</select>