36 lines
894 B
Svelte
36 lines
894 B
Svelte
<script lang="ts">
|
|
import { navigating, page } from '$app/state'
|
|
import { t } from '$lib/app/i18n'
|
|
import { Button, TextInput } from 'mono-svelte'
|
|
import { MagnifyingGlass } from 'svelte-hero-icons/dist'
|
|
|
|
interface Props {
|
|
query?: string | null
|
|
}
|
|
|
|
let { query = $bindable() }: Props = $props()
|
|
|
|
let searchElement = $state<HTMLInputElement>()
|
|
</script>
|
|
|
|
<div class="flex gap-2 flex-row items-center w-full text-base h-10">
|
|
<TextInput
|
|
bind:value={query}
|
|
bind:element={searchElement}
|
|
name="q"
|
|
placeholder={$t('routes.search.query')}
|
|
size="lg"
|
|
class="flex-1 rounded-full! h-full text-base!"
|
|
/>
|
|
<Button
|
|
submit
|
|
color="primary"
|
|
size="custom"
|
|
class="shrink-0 h-full aspect-square shadow-md"
|
|
title="Search"
|
|
rounding="pill"
|
|
loading={navigating.to?.route.id == page.url.pathname}
|
|
icon={MagnifyingGlass}
|
|
></Button>
|
|
</div>
|