refactor(admin/users): extract user form sub-components

Shared (src/lib/components/user/):
- UserProfileSection.svelte: name/birth-date/email/contact fields
- UserGroupsSection.svelte: group checkboxes
- UserPasswordSection.svelte: new/confirm password fields

Page-local:
- admin/users/new/AccountSection.svelte: username + initial password

admin/users/[id] drops from 224 → ~35 lines.
admin/users/new drops from 191 → ~30 lines.
Date utilities imported from \$lib/utils/date.

Part of #75

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-03-26 12:17:55 +01:00
parent 6f71682454
commit 25014cce2d
6 changed files with 200 additions and 267 deletions

View File

@@ -0,0 +1,24 @@
<script lang="ts">
let {
groups,
selectedGroupIds = []
}: {
groups: { id: string; name: string }[];
selectedGroupIds?: string[];
} = $props();
</script>
<div class="flex flex-wrap gap-3">
{#each groups as group (group.id)}
<label class="inline-flex items-center gap-2 text-sm text-ink-2">
<input
type="checkbox"
name="groupIds"
value={group.id}
checked={selectedGroupIds.includes(group.id)}
class="rounded border-line text-ink focus:ring-accent"
/>
{group.name}
</label>
{/each}
</div>