Files
sam-react-prod/src/app/[locale]/(protected)/settings/popup-management/[id]/page.tsx
byeongcheolryu c6b605200d feat: 신규 페이지 구현 및 HR/설정 기능 개선
신규 페이지:
- 회계관리: 거래처, 예상비용, 청구서, 발주서
- 게시판: 공지사항, 자료실, 커뮤니티
- 고객센터: 문의/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>
2025-12-19 19:12:34 +09:00

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>
&quot;{popup.title}&quot; ?
<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>
</>
);
}