2022-10-13 04:17:30 +00:00
|
|
|
<script lang="ts">
|
2023-05-15 04:08:30 +00:00
|
|
|
import { superForm } from 'sveltekit-superforms/client';
|
2022-10-13 04:17:30 +00:00
|
|
|
import { gameStore } from '$lib/stores/gameSearchStore';
|
2022-10-14 04:01:01 +00:00
|
|
|
import TextSearch from '$lib/components/search/textSearch/index.svelte';
|
2022-10-13 04:17:30 +00:00
|
|
|
|
2023-05-15 04:08:30 +00:00
|
|
|
export let data;
|
|
|
|
|
const { form, errors, constraints } = superForm(data?.form);
|
2022-10-13 04:17:30 +00:00
|
|
|
|
2023-05-15 04:08:30 +00:00
|
|
|
$: if (data?.searchData?.games) {
|
2022-10-13 04:17:30 +00:00
|
|
|
gameStore.removeAll();
|
2023-05-15 04:08:30 +00:00
|
|
|
gameStore.addAll(data?.searchData?.games);
|
2022-10-14 03:54:44 +00:00
|
|
|
}
|
2022-10-13 04:17:30 +00:00
|
|
|
</script>
|
|
|
|
|
|
2022-10-14 04:01:01 +00:00
|
|
|
<div class="game-search">
|
2023-05-15 04:08:30 +00:00
|
|
|
<TextSearch showButton advancedSearch {form} {errors} {constraints} />
|
2022-10-14 04:01:01 +00:00
|
|
|
</div>
|