Refactor player handling: replace player arrays with IDs, implement PlayerSelector component
This commit is contained in:
@@ -23,8 +23,7 @@
|
||||
import {PlusOutline} from "flowbite-svelte-icons";
|
||||
import SWModal from "@components/styled/SWModal.svelte";
|
||||
import SWButton from "@components/styled/SWButton.svelte";
|
||||
import TypeAheadSearch from "@components/admin/components/TypeAheadSearch.svelte";
|
||||
import {players} from "@stores/stores.ts";
|
||||
import PlayerSelector from "@components/ui/PlayerSelector.svelte";
|
||||
import {eventRepo} from "@repo/event.ts";
|
||||
|
||||
interface Props {
|
||||
@@ -102,8 +101,7 @@
|
||||
<SWModal title="Schiedsrichter hinzufügen" bind:open={showAdd}>
|
||||
<div class="flex flex-grow justify-center h-80">
|
||||
<div>
|
||||
<TypeAheadSearch bind:searchValue bind:selected={selectedPlayer}
|
||||
items={$players.map(v => ({ name: v.name, value: v.uuid }))}/>
|
||||
<PlayerSelector bind:value={selectedPlayer} placeholder="Search player..." />
|
||||
</div>
|
||||
</div>
|
||||
{#snippet footer()}
|
||||
|
||||
Reference in New Issue
Block a user