Skip to content

Commit 4c25b16

Browse files
committed
feat: add DeleteConfirmModal component for deletion confirmation
1 parent d589dae commit 4c25b16

File tree

1 file changed

+48
-0
lines changed

1 file changed

+48
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import { useModalContext } from '@/features/modal';
2+
3+
import Button from '@/components/Button';
4+
5+
interface DeleteConfirmModalProps {
6+
onCancel?: () => void;
7+
onConfirm?: () => void;
8+
}
9+
10+
function DeleteConfirmModal({ onCancel, onConfirm }: DeleteConfirmModalProps) {
11+
const { closeModal } = useModalContext();
12+
13+
return (
14+
<div className='inline-flex flex-col items-center justify-center gap-2.5 rounded-lg bg-gray-50 p-8 shadow'>
15+
<div className='flex h-[8dvh] min-w-[20dvw] flex-col justify-center gap-2'>
16+
<div className='w-full text-center font-bold'>
17+
<span>정말 삭제하시겠습니까?</span>
18+
</div>
19+
<div className='mx-auto mt-4 inline-flex w-full items-start justify-center gap-2.5'>
20+
<Button
21+
className='w-full bg-gray-500'
22+
onClick={() => {
23+
onCancel?.();
24+
closeModal();
25+
}}
26+
>
27+
<span className='flex-grow text-sm font-medium text-white'>
28+
취소하기
29+
</span>
30+
</Button>
31+
<Button
32+
className='w-full bg-indigo-600 transition-colors duration-200'
33+
onClick={() => {
34+
onConfirm?.();
35+
closeModal();
36+
}}
37+
>
38+
<span className='flex-grow text-sm font-medium text-white'>
39+
삭제하기
40+
</span>
41+
</Button>
42+
</div>
43+
</div>
44+
</div>
45+
);
46+
}
47+
48+
export default DeleteConfirmModal;

0 commit comments

Comments
 (0)