diff --git a/src/features/clinics/components/cards/AnalysisCard.tsx b/src/features/clinics/components/cards/AnalysisCard.tsx index 310f73c..c3d6adb 100644 --- a/src/features/clinics/components/cards/AnalysisCard.tsx +++ b/src/features/clinics/components/cards/AnalysisCard.tsx @@ -34,8 +34,8 @@ function formatDate(iso: string) { interface AnalysisCardProps { clinicId: string; run: WorkspaceRun; - /** 모든 run 은 1:1 로 연결된 plan 을 가짐 */ - plan: WorkspacePlan; + /** plan 이 있으면 1:1 매칭, 없으면 plan 미생성 상태 */ + plan?: WorkspacePlan; /** 최신 row 강조 */ highlighted?: boolean; } @@ -44,13 +44,10 @@ export function AnalysisCard({ clinicId, run, plan, highlighted = false }: Analy const navigate = useNavigate(); const status = statusBadge(run.status); - // 가라데이터 데모 — 실제 리포트/플랜 ID 대신 view-clinic 데모 데이터로 진입. - // 실 데이터 연동 시 `/clinics/${clinicId}/report/${run.runId}` 등으로 복원. - void clinicId; - void run.runId; - void plan.planId; - const reportHref = '/report/view-clinic'; - const planHref = '/plan/view-clinic'; + // PlanPage 는 두 경로 모두에서 동일 — 워크스페이스 경로로 진입해야 향후 권한/액션 차별화 여지 확보. + void plan?.planId; + const reportHref = `/report/${run.runId}`; + const planHref = `/clinics/${clinicId}/plan/${run.runId}`; const goToReport = () => navigate(reportHref); const stop = (e: React.MouseEvent) => e.stopPropagation(); diff --git a/src/features/clinics/components/tabs/AnalysisTab.tsx b/src/features/clinics/components/tabs/AnalysisTab.tsx index ffe3455..0488d9a 100644 --- a/src/features/clinics/components/tabs/AnalysisTab.tsx +++ b/src/features/clinics/components/tabs/AnalysisTab.tsx @@ -34,12 +34,12 @@ export function AnalysisTab({ clinicId, runs, plans }: AnalysisTabProps) { return map; }, [plans]); + // plan 이 없는 run 도 노출 — 백엔드 plans 엔드포인트가 채워지면 자연스럽게 매칭됨. const rows = useMemo( () => [...runs] .sort((a, b) => new Date(b.startedAt).getTime() - new Date(a.startedAt).getTime()) - .map((run) => ({ run, plan: planByRun[run.runId] })) - .filter((row): row is { run: WorkspaceRun; plan: WorkspacePlan } => !!row.plan), + .map((run) => ({ run, plan: planByRun[run.runId] })), [runs, planByRun], ); diff --git a/src/features/clinics/components/tabs/SettingsTab.tsx b/src/features/clinics/components/tabs/SettingsTab.tsx index 47447e8..a9027e3 100644 --- a/src/features/clinics/components/tabs/SettingsTab.tsx +++ b/src/features/clinics/components/tabs/SettingsTab.tsx @@ -4,7 +4,6 @@ * 분석 대상 URL/소셜 핸들 편집 + 병원 기본 정보 확인. */ import { useState } from 'react'; -import { Save, AlertCircle, Info } from 'lucide-react'; import { Input } from '@/shared/ui/input'; import { Button } from '@/shared/ui/button'; import { SectionWrapper } from '@/features/report/components/ui/SectionWrapper'; @@ -66,7 +65,7 @@ export function SettingsTab({ clinic }: SettingsTabProps) { return (
@@ -82,20 +81,13 @@ export function SettingsTab({ clinic }: SettingsTabProps) {
{EDITABLE_PLATFORMS.map((platform) => { const meta = PLATFORM_META[platform]; - const Icon = meta.Icon; return (
{platform === 'website' && ( -

- +

홈페이지를 변경하면 다음 분석부터 병원 기본 정보(이름·주소·진료시간·의료진 등)가 새 사이트 기준으로 함께 갱신돼요.

)} @@ -119,28 +110,18 @@ export function SettingsTab({ clinic }: SettingsTabProps) {

- {saved ? ( - <> - - 로컬에 저장되었습니다 (API 연동 후속 작업) - - ) : ( - <> - - 저장은 아직 서버에 반영되지 않습니다. - - )} + {saved + ? '로컬에 저장되었습니다 (API 연동 후속 작업)' + : '저장은 아직 서버에 반영되지 않습니다.'}

diff --git a/src/features/clinics/pages/ClinicProfilePage.tsx b/src/features/clinics/pages/ClinicProfilePage.tsx index cf1810e..fc783a9 100644 --- a/src/features/clinics/pages/ClinicProfilePage.tsx +++ b/src/features/clinics/pages/ClinicProfilePage.tsx @@ -25,7 +25,7 @@ import { Heart, TrendingUp, } from 'lucide-react'; -import { useGetReport } from '@/shared/api/generated/reports/reports'; +import { useGetReport } from '@/shared/api/generated/report/report'; import { PageContainer } from '@/shared/ui/page-container'; import { CLINIC, DOCTORS, RATINGS, PROCEDURES } from '../data/mockClinicProfile'; diff --git a/src/features/clinics/routes.tsx b/src/features/clinics/routes.tsx index 174d085..83bcb93 100644 --- a/src/features/clinics/routes.tsx +++ b/src/features/clinics/routes.tsx @@ -4,7 +4,7 @@ import type { RouteObject } from 'react-router' const ClinicProfilePage = lazy(() => import('./pages/ClinicProfilePage')) const ClinicWorkspacePage = lazy(() => import('./pages/ClinicWorkspacePage')) const UserReportPage = lazy(() => import('@/features/report/pages/UserReportPage')) -const UserPlanPage = lazy(() => import('@/features/plan/pages/UserPlanPage')) +const PlanPage = lazy(() => import('@/features/plan/pages/PlanPage')) export const clinicsRoutes: RouteObject[] = [ // 공개 프로필 (손님/누구나) @@ -13,5 +13,5 @@ export const clinicsRoutes: RouteObject[] = [ // 유저 워크스페이스 (계약 병원 전용) { path: 'clinics/:clinicId', element: }, { path: 'clinics/:clinicId/report/:id', element: }, - { path: 'clinics/:clinicId/plan/:id', element: }, + { path: 'clinics/:clinicId/plan/:id', element: }, ]