17 lines
416 B
Svelte
17 lines
416 B
Svelte
<script lang="ts">
|
|
import { goto } from '$app/navigation'
|
|
import SearchInput from '$lib/SearchInput.svelte'
|
|
export let value: string | null = null
|
|
async function lookupDomain(value: string) {
|
|
await goto(`/lookup?q=${encodeURIComponent(value)}`)
|
|
}
|
|
</script>
|
|
|
|
<SearchInput
|
|
bind:value
|
|
onSubmit={lookupDomain}
|
|
pattern="(\S+\.)+\S\S+"
|
|
placeholder="example.com"
|
|
invalidMessage="Input is not a valid domain"
|
|
/>
|