Refactor player components: streamline state management and improve code readability in PermissionsDropdown, Players, and PrefixDropdown
Some checks failed
SteamWarCI Build failed

This commit is contained in:
2025-12-02 22:35:32 +01:00
parent 3bde299ea5
commit e1220ff5ac
4 changed files with 26 additions and 24 deletions

View File

@@ -18,16 +18,18 @@
-->
<script lang="ts">
import {Select, SelectContent, SelectItem, SelectTrigger} from "@components/ui/select";
import {permissions} from "@stores/stores.ts";
import {permsRepo} from "@repo/perms.ts";
import { Select, SelectContent, SelectItem, SelectTrigger } from "@components/ui/select";
import { permissions } from "@stores/stores.ts";
import { permsRepo } from "@repo/perms.ts";
const {
prefix, uuid
}: { prefix: string, uuid: string } = $props();
const { prefix, uuid }: { prefix: string; uuid: string } = $props();
let value = $state(prefix);
$effect(() => {
value = prefix;
});
function onChange(change: string) {
$permsRepo.setPrefix(uuid, change);
@@ -44,4 +46,4 @@
<SelectItem value={prefix[0]}>{prefix[1].chatPrefix === "" ? "None" : prefix[1].chatPrefix}</SelectItem>
{/each}
</SelectContent>
</Select>
</Select>