mirror of
https://github.com/kmc7468/arkvault.git
synced 2026-02-04 16:16:55 +00:00
기존에 제작된 모달들을 ActionModal 컴포넌트 기반으로 재구성
This commit is contained in:
33
src/routes/(main)/directory/[[id]]/EntryDeleteModal.svelte
Normal file
33
src/routes/(main)/directory/[[id]]/EntryDeleteModal.svelte
Normal file
@@ -0,0 +1,33 @@
|
||||
<script lang="ts">
|
||||
import { ActionModal } from "$lib/components/molecules";
|
||||
import { truncateString } from "$lib/modules/util";
|
||||
import { useContext } from "./service.svelte";
|
||||
|
||||
interface Props {
|
||||
isOpen: boolean;
|
||||
onDeleteClick: () => Promise<boolean>;
|
||||
}
|
||||
|
||||
let { isOpen = $bindable(), onDeleteClick }: Props = $props();
|
||||
let context = useContext();
|
||||
</script>
|
||||
|
||||
{#if context.selectedEntry}
|
||||
{@const { name, type } = context.selectedEntry}
|
||||
<ActionModal
|
||||
bind:isOpen
|
||||
title="'{truncateString(name)}' {type === 'directory' ? '폴더를' : '파일을'} 삭제할까요?"
|
||||
cancelText="아니요"
|
||||
confirmText="삭제할게요"
|
||||
onConfirmClick={onDeleteClick}
|
||||
>
|
||||
<p>
|
||||
{#if type === "directory"}
|
||||
삭제한 폴더는 복구할 수 없어요. <br />
|
||||
폴더 안의 모든 파일과 폴더도 함께 삭제돼요.
|
||||
{:else}
|
||||
삭제한 파일은 복구할 수 없어요.
|
||||
{/if}
|
||||
</p>
|
||||
</ActionModal>
|
||||
{/if}
|
||||
Reference in New Issue
Block a user