feat: 5개 병원 데모 추가 (바노바기/그랜드/원진/티에스/이룸)
- 각 병원 mockReport + mockPlan 파일 생성 (YouTube 실측치 기반) - YouTube 실측: 바노바기 13K/925개, 원진 14.1K, 티에스 8K/715개, 그랜드 2.37K/332개, 이룸(서울아이) 322/155개 - 채널별 스크린샷 PNG 30개 캡처 (Playwright headless) - useReport + useMarketingPlan Hook에 5개 병원 DEMO_REPORTS/DEMO_PLANS 확장 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
6b2cc7ef79
commit
d66bc7b8f8
42 files changed
+2012
-4
No files matched your search
@@ -4,6 +4,20 @@ import type { MarketingPlan, ChannelStrategyCard, CalendarData, ContentStrategyD
|
||||
import { fetchReportById, fetchActiveContentPlan, supabase } from '../lib/supabase';
|
||||
import { transformReportToPlan } from '../lib/transformPlan';
|
||||
import { mockPlan } from '../data/mockPlan';
|
||||
import { mockPlanBanobagi } from '../data/mockPlan_banobagi';
|
||||
import { mockPlanGrand } from '../data/mockPlan_grand';
|
||||
import { mockPlanWonjin } from '../data/mockPlan_wonjin';
|
||||
import { mockPlanTs } from '../data/mockPlan_ts';
|
||||
import { mockPlanIrum } from '../data/mockPlan_irum';
|
||||
|
||||
const DEMO_PLANS: Record<string, MarketingPlan> = {
|
||||
'view-clinic': mockPlan,
|
||||
'banobagi': mockPlanBanobagi,
|
||||
'grand': mockPlanGrand,
|
||||
'wonjin': mockPlanWonjin,
|
||||
'ts': mockPlanTs,
|
||||
'irum': mockPlanIrum,
|
||||
};
|
||||
|
||||
interface UseMarketingPlanResult {
|
||||
data: MarketingPlan | null;
|
||||
@@ -89,11 +103,16 @@ export function useMarketingPlan(id: string | undefined): UseMarketingPlanResult
|
||||
async function loadPlan() {
|
||||
try {
|
||||
// ─── Dev / Demo: return mock data immediately ───
|
||||
if (id === 'demo' || id === 'view-clinic') {
|
||||
if (id === 'demo') {
|
||||
setData(mockPlan);
|
||||
setIsLoading(false);
|
||||
return;
|
||||
}
|
||||
if (id && id in DEMO_PLANS) {
|
||||
setData(DEMO_PLANS[id]);
|
||||
setIsLoading(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// ─── Source 1: Try content_plans table (AI-generated strategy) ───
|
||||
// First, resolve clinicId from navigation state or analysis_runs
|
||||
|
||||
+26
-3
@@ -5,6 +5,29 @@ import { fetchReportById } from '../lib/supabase';
|
||||
import { transformApiReport, mergeEnrichment, type EnrichmentData } from '../lib/transformReport';
|
||||
import { normalizeInstagramHandle } from '../lib/normalizeHandles';
|
||||
import { mockReport } from '../data/mockReport';
|
||||
import { mockReportBanobagi } from '../data/mockReport_banobagi';
|
||||
import { mockReportGrand } from '../data/mockReport_grand';
|
||||
import { mockReportWonjin } from '../data/mockReport_wonjin';
|
||||
import { mockReportTs } from '../data/mockReport_ts';
|
||||
import { mockReportIrum } from '../data/mockReport_irum';
|
||||
|
||||
const DEMO_REPORTS: Record<string, MarketingReport> = {
|
||||
'view-clinic': mockReport,
|
||||
'banobagi': mockReportBanobagi,
|
||||
'grand': mockReportGrand,
|
||||
'wonjin': mockReportWonjin,
|
||||
'ts': mockReportTs,
|
||||
'irum': mockReportIrum,
|
||||
};
|
||||
|
||||
const DEMO_HANDLES: Record<string, Record<string, string | null>> = {
|
||||
'view-clinic': { instagram: '@viewplastic', youtube: '@ViewclinicKR', facebook: 'viewps1' },
|
||||
'banobagi': { instagram: '@banobagi_ps', youtube: '@banobagips', facebook: 'BanobagiPlasticSurgery' },
|
||||
'grand': { instagram: '@grand_korea', youtube: '@grandsurgery_QnA', facebook: 'grandps.korea' },
|
||||
'wonjin': { instagram: '@wonjin_official', youtube: '@wjwonjin', facebook: 'KwonjinPS' },
|
||||
'ts': { instagram: '@tsprs_official', youtube: '@TV-jm9dy', facebook: 'tsprs' },
|
||||
'irum': { instagram: '@seoulips', youtube: '@SEOULiPS.', facebook: null },
|
||||
};
|
||||
|
||||
interface UseReportResult {
|
||||
data: MarketingReport | null;
|
||||
@@ -39,10 +62,10 @@ export function useReport(id: string | undefined): UseReportResult {
|
||||
|
||||
useEffect(() => {
|
||||
// Source 0: Demo mode — ALWAYS takes priority over any other source
|
||||
if (id === 'view-clinic') {
|
||||
setData(mockReport);
|
||||
if (id && id in DEMO_REPORTS) {
|
||||
setData(DEMO_REPORTS[id]);
|
||||
setIsEnriched(true);
|
||||
setSocialHandles({ instagram: '@viewplastic', youtube: '@ViewclinicKR', facebook: 'viewps1' });
|
||||
setSocialHandles(DEMO_HANDLES[id] ?? null);
|
||||
setIsLoading(false);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user