mirror of
https://codeberg.org/demostf/frontend.git
synced 2026-06-03 18:24:12 +02:00
filterbar wip
This commit is contained in:
parent
10ea8ddcbc
commit
e5c9aeb7fe
15 changed files with 1905 additions and 420 deletions
19
script/filterbar.tsx
Normal file
19
script/filterbar.tsx
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import {Select, createOptions, createAsyncOptions} from "@thisbeyond/solid-select";
|
||||
import {Api} from "./api";
|
||||
|
||||
export interface FilterBarProps {
|
||||
maps: string[],
|
||||
api: Api,
|
||||
}
|
||||
|
||||
export const FilterBar = ({maps, api}: FilterBarProps) => {
|
||||
const modes = createOptions(["4v4", "6v6", "Highlander"]);
|
||||
const mapOptions = createOptions(maps);
|
||||
const playerOptions = createAsyncOptions(search => api.searchPlayer(search));
|
||||
const playerFormat = player => player.name;
|
||||
return <div class="filter-bar">
|
||||
<Select class="mode" placeholder="All Types" {...modes} />
|
||||
<Select class="maps" placeholder="All Maps" {...mapOptions} />
|
||||
<Select class="players" multiple placeholder="All Players" format={playerFormat} {...playerOptions} />
|
||||
</div>;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue