/** * UserPlanPage — `/clinics/:clinicId/plan/:id` * * 계약된 병원 유저가 워크스페이스에서 운영하는 마케팅 기획 화면. * GuestPlanPage 의 본문 + 워크스페이스 액션바 + 인터랙티브 섹션 * (MyAssetUpload / StrategyAdjustmentSection / WorkflowTracker). */ import { useEffect } from 'react'; import { Link, useParams, useLocation } from 'react-router'; import { ArrowLeft, FileSearch } from 'lucide-react'; import { useMarketingPlan } from '../hooks/useMarketingPlan'; import { ReportNav } from '@/features/report/components/ReportNav'; import { PdfDownloadButton } from '@/features/report/components/PdfDownloadButton'; import { PLAN_SECTIONS } from '@/shared/constants/planSections'; import PlanBody from '../components/PlanBody'; import MyAssetUpload from '../components/MyAssetUpload'; import StrategyAdjustmentSection from '../components/StrategyAdjustmentSection'; import WorkflowTracker from '../components/WorkflowTracker'; export default function UserPlanPage() { const { clinicId, id } = useParams<{ clinicId: string; id: string }>(); const location = useLocation(); const stateClinicId = (location.state as { clinicId?: string } | undefined)?.clinicId || null; const { data, isLoading, error } = useMarketingPlan(id); useEffect(() => { if (isLoading || !location.hash) return; const sectionId = location.hash.slice(1); const timer = setTimeout(() => { const el = document.getElementById(sectionId); if (!el) return; const STICKY_OFFSET = 128; const y = el.getBoundingClientRect().top + window.scrollY - STICKY_OFFSET; window.scrollTo({ top: y, behavior: 'smooth' }); }, 300); return () => clearTimeout(timer); }, [isLoading, location.hash]); if (isLoading) { return (
마케팅 기획을 불러오는 중...
오류가 발생했습니다
{error ?? '마케팅 기획을 찾을 수 없습니다.'}