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

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

@@ -1,24 +1,27 @@
<script lang="ts">
import { Modal } from "$lib/components";
import { Button } from "$lib/components/buttons";
import type { SelectedDirectoryEntry } from "./+page.svelte";
import type { SelectedDirectoryEntry } from "./service";
interface Props {
onDeleteClick: () => Promise<boolean>;
isOpen: boolean;
selectedEntry: SelectedDirectoryEntry | undefined;
}
let { isOpen = $bindable(), selectedEntry = $bindable() }: Props = $props();
let { onDeleteClick, isOpen = $bindable(), selectedEntry = $bindable() }: Props = $props();
const closeModal = () => {
isOpen = false;
selectedEntry = undefined;
};
const deleteEntry = () => {
// TODO
const deleteEntry = async () => {
// TODO: Validation
closeModal();
if (await onDeleteClick()) {
closeModal();
}
};
</script>