파일/폴더 삭제 및 이름 변경 구현 완료

This commit is contained in:
static
2025-01-06 14:30:00 +09:00
parent bd0dd3343a
commit 71f12c942b
6 changed files with 75 additions and 27 deletions

View File

@@ -2,14 +2,15 @@
import { Modal } from "$lib/components";
import { Button } from "$lib/components/buttons";
import { TextInput } from "$lib/components/inputs";
import type { SelectedDirectoryEntry } from "./+page.svelte";
import type { SelectedDirectoryEntry } from "./service";
interface Props {
onRenameClick: (newName: string) => Promise<boolean>;
isOpen: boolean;
selectedEntry: SelectedDirectoryEntry | undefined;
}
let { isOpen = $bindable(), selectedEntry = $bindable() }: Props = $props();
let { onRenameClick, isOpen = $bindable(), selectedEntry = $bindable() }: Props = $props();
let name = $state("");
@@ -19,10 +20,12 @@
selectedEntry = undefined;
};
const renameEntry = () => {
// TODO
const renameEntry = async () => {
// TODO: Validation
closeModal();
if (await onRenameClick(name)) {
closeModal();
}
};
$effect(() => {