신규 페이지: - 회계관리: 거래처, 예상비용, 청구서, 발주서 - 게시판: 공지사항, 자료실, 커뮤니티 - 고객센터: 문의/FAQ - 설정: 계정, 알림, 출퇴근, 팝업, 구독, 결제내역 - 리포트 (차트 시각화) - 개발자 테스트 URL 페이지 기능 개선: - HR 직원관리/휴가관리/카드관리 강화 - IntegratedListTemplateV2 확장 - AuthenticatedLayout 패딩 표준화 - 로그인 페이지 UI 개선 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
90 lines
2.6 KiB
TypeScript
90 lines
2.6 KiB
TypeScript
'use client';
|
|
|
|
import { useRouter, useParams } from 'next/navigation';
|
|
import { useState, useEffect } from 'react';
|
|
import { PopupDetail } from '@/components/settings/PopupManagement';
|
|
import {
|
|
AlertDialog,
|
|
AlertDialogAction,
|
|
AlertDialogCancel,
|
|
AlertDialogContent,
|
|
AlertDialogDescription,
|
|
AlertDialogFooter,
|
|
AlertDialogHeader,
|
|
AlertDialogTitle,
|
|
} from '@/components/ui/alert-dialog';
|
|
import { MOCK_POPUPS, type Popup } from '@/components/settings/PopupManagement/types';
|
|
|
|
export default function PopupDetailPage() {
|
|
const router = useRouter();
|
|
const params = useParams();
|
|
const [popup, setPopup] = useState<Popup | null>(null);
|
|
const [deleteDialogOpen, setDeleteDialogOpen] = useState(false);
|
|
|
|
useEffect(() => {
|
|
// TODO: API 연동
|
|
const id = params.id as string;
|
|
const found = MOCK_POPUPS.find((p) => p.id === id);
|
|
setPopup(found || null);
|
|
}, [params.id]);
|
|
|
|
const handleEdit = () => {
|
|
router.push(`/ko/settings/popup-management/${params.id}/edit`);
|
|
};
|
|
|
|
const handleDelete = () => {
|
|
setDeleteDialogOpen(true);
|
|
};
|
|
|
|
const confirmDelete = () => {
|
|
// TODO: API 연동
|
|
console.log('Delete popup:', params.id);
|
|
router.push('/ko/settings/popup-management');
|
|
};
|
|
|
|
if (!popup) {
|
|
return (
|
|
<div className="flex items-center justify-center min-h-[400px]">
|
|
<div className="text-center">
|
|
<div className="inline-block h-8 w-8 animate-spin rounded-full border-4 border-solid border-primary border-r-transparent mb-4"></div>
|
|
<p className="text-muted-foreground">로딩 중...</p>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<>
|
|
<PopupDetail
|
|
popup={popup}
|
|
onEdit={handleEdit}
|
|
onDelete={handleDelete}
|
|
/>
|
|
|
|
<AlertDialog open={deleteDialogOpen} onOpenChange={setDeleteDialogOpen}>
|
|
<AlertDialogContent>
|
|
<AlertDialogHeader>
|
|
<AlertDialogTitle>팝업 삭제</AlertDialogTitle>
|
|
<AlertDialogDescription>
|
|
"{popup.title}" 팝업을 삭제하시겠습니까?
|
|
<br />
|
|
<span className="text-destructive">
|
|
삭제된 팝업 정보는 복구할 수 없습니다.
|
|
</span>
|
|
</AlertDialogDescription>
|
|
</AlertDialogHeader>
|
|
<AlertDialogFooter>
|
|
<AlertDialogCancel>취소</AlertDialogCancel>
|
|
<AlertDialogAction
|
|
onClick={confirmDelete}
|
|
className="bg-destructive text-destructive-foreground hover:bg-destructive/90"
|
|
>
|
|
삭제
|
|
</AlertDialogAction>
|
|
</AlertDialogFooter>
|
|
</AlertDialogContent>
|
|
</AlertDialog>
|
|
</>
|
|
);
|
|
}
|