feat(persons): add /persons/[id]/edit route with PersonEditForm, PersonDangerZone
New edit route with WRITE_ALL guard; PersonEditForm (6 fields), sticky PersonEditSaveBar, collapsed PersonDangerZone with PersonMergePanel. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<script lang="ts">
|
||||
import { m } from '$lib/paraglide/messages.js';
|
||||
import PersonMergePanel from '../PersonMergePanel.svelte';
|
||||
|
||||
let {
|
||||
person,
|
||||
form
|
||||
}: {
|
||||
person: { id: string; firstName: string; lastName: string };
|
||||
form?: { mergeError?: string } | null;
|
||||
} = $props();
|
||||
|
||||
let open = $state(false);
|
||||
</script>
|
||||
|
||||
<div class="mt-8 overflow-hidden rounded-sm border border-red-200 bg-surface shadow-sm">
|
||||
<button
|
||||
type="button"
|
||||
onclick={() => (open = !open)}
|
||||
class="flex w-full items-center justify-between px-6 py-4 text-left"
|
||||
aria-expanded={open}
|
||||
>
|
||||
<span class="text-sm font-bold tracking-widest text-red-600 uppercase">
|
||||
{m.person_danger_zone_heading()}
|
||||
</span>
|
||||
<svg
|
||||
class="h-4 w-4 text-red-400 transition-transform {open ? 'rotate-180' : ''}"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
aria-hidden="true"
|
||||
>
|
||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7" />
|
||||
</svg>
|
||||
</button>
|
||||
|
||||
{#if open}
|
||||
<div class="border-t border-red-100 px-6 py-4">
|
||||
{#key person.id}
|
||||
<PersonMergePanel person={person} form={form} />
|
||||
{/key}
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
Reference in New Issue
Block a user