'use client';

import { useParams } from 'next/navigation';
import { PopupForm } from '@/components/settings/PopupManagement';
import { MOCK_POPUPS } from '@/components/settings/PopupManagement/types';

export default function PopupEditPage() {
  const params = useParams();
  const id = params.id as string;

  // Mock: ID로 팝업 데이터 조회
  const popup = MOCK_POPUPS.find((p) => p.id === id);

  if (!popup) {
    return (
      <div className="flex items-center justify-center min-h-[400px]">
        <p className="text-muted-foreground">팝업을 찾을 수 없습니다.</p>
      </div>
    );
  }

  return <PopupForm mode="edit" initialData={popup} />;
}