blob: 7db4885385680a09dbf347232cb047e01eb9bc7f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
<script lang="ts">
import { selectedDomain } from '$lib/stores/mirror';
interface Props {
domains: string[];
}
let { domains }: Props = $props();
function getHostname(url: string) {
try {
return new URL(url).hostname;
} catch {
return url;
}
}
</script>
<div class="controls">
<label for="mirror-select">Select Mirror: </label>
<select id="mirror-select" bind:value={$selectedDomain}>
{#each domains as domain}
<option value={domain}>{getHostname(domain)}</option>
{/each}
</select>
</div>
|