{#snippet formFields()}
{m.relation_form_field_type()}
{m.relation_parent_of()}
{m.relation_spouse_of()}
{m.relation_sibling_of()}
{m.relation_friend()}
{m.relation_colleague()}
{m.relation_employer()}
{m.relation_doctor()}
{m.relation_neighbor()}
{m.relation_other()}
{m.relation_label_notes()}
{#if selfError}
{selfError}
{/if} {#if callbackError}
{callbackError}
{/if}
{m.relation_btn_cancel()}
{#if submitting}
{/if} {isEdit ? m.relation_btn_save() : m.relation_btn_add()}
{/snippet} {#if !open}
(open = true)} class="mt-2 inline-flex items-center gap-1 font-sans text-xs font-medium text-ink-2 hover:text-ink" > {m.stammbaum_panel_add_rel()}
{:else if onSubmit}
{@render formFields()}
{:else}
{ submitting = true; return async ({ result, update }) => { await update(); submitting = false; if (result.type === 'success') { if (isEdit) { onClose?.(); } else { open = false; reset(); } } }; }} class="mt-3 rounded-sm border border-line bg-muted/40 p-3" > {#if relationship}
{/if} {@render formFields()}
{/if}