@@ -204,10 +193,7 @@
icon={mdiPencilOutline}
title={$t('edit_import_path')}
size="16"
- onclick={() => {
- editImportPath = listIndex;
- editedImportPath = validatedPath.importPath;
- }}
+ onclick={() => onEditImportPath(listIndex)}
/>
@@ -221,7 +207,7 @@
{/if}
-
+
|
diff --git a/web/src/lib/components/forms/library-import-path-form.svelte b/web/src/lib/modals/LibraryImportPathModal.svelte
similarity index 82%
rename from web/src/lib/components/forms/library-import-path-form.svelte
rename to web/src/lib/modals/LibraryImportPathModal.svelte
index ee2a273708c..56a5449fef8 100644
--- a/web/src/lib/components/forms/library-import-path-form.svelte
+++ b/web/src/lib/modals/LibraryImportPathModal.svelte
@@ -11,9 +11,7 @@
cancelText?: string;
submitText?: string;
isEditing?: boolean;
- onCancel: () => void;
- onSubmit: (importPath: string | null) => void;
- onDelete?: () => void;
+ onClose: (data?: { action: 'delete' } | { action: 'submit'; importPath: string | null }) => void;
}
let {
@@ -23,9 +21,7 @@
cancelText = $t('cancel'),
submitText = $t('save'),
isEditing = false,
- onCancel,
- onSubmit,
- onDelete,
+ onClose,
}: Props = $props();
onMount(() => {
@@ -40,12 +36,12 @@
const onsubmit = (event: Event) => {
event.preventDefault();
if (canSubmit) {
- onSubmit(importPath);
+ onClose({ action: 'submit', importPath });
}
};
-
+
diff --git a/web/src/lib/components/forms/library-rename-form.svelte b/web/src/lib/modals/LibraryRenameModal.svelte
similarity index 73%
rename from web/src/lib/components/forms/library-rename-form.svelte
rename to web/src/lib/modals/LibraryRenameModal.svelte
index 0c04c77da10..9ba8048316e 100644
--- a/web/src/lib/components/forms/library-rename-form.svelte
+++ b/web/src/lib/modals/LibraryRenameModal.svelte
@@ -6,21 +6,20 @@
interface Props {
library: Partial;
- onCancel: () => void;
- onSubmit: (library: Partial) => void;
+ onClose: (library?: Partial) => void;
}
- let { library, onCancel, onSubmit }: Props = $props();
+ let { library, onClose }: Props = $props();
let newName = $state(library.name);
const onsubmit = (event: Event) => {
event.preventDefault();
- onSubmit({ ...library, name: newName });
+ onClose({ ...library, name: newName });
};
-
+