fix: remove all hardcoded view-clinic references for dynamic report routing

- useReport: remove view-clinic guard so any reportId fetches from Supabase
- KPIDashboard: dynamic plan link + clinicName-based PDF filename
- PlanCTA: dynamic studio path via useParams
- PageNavigator: prefix-based path matching for dynamic route IDs
- Navbar/Footer: logo links to landing via React Router Link

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Haewon KamandClaude Opus 4.6 committed 2026-04-02 12:02:34 +09:00
1 parent 60cd055042
commit 2d6e95c414
7 files changed
+53 -25

No files matched your search

+6 -3
View File
@@ -1,4 +1,5 @@
import { motion } from 'motion/react';
import { useParams } from 'react-router';
import { TrendingUp, ArrowUpRight, Download, Loader2 } from 'lucide-react';
import { SectionWrapper } from './ui/SectionWrapper';
import { useExportPDF } from '../../hooks/useExportPDF';
@@ -6,6 +7,7 @@ import type { KPIMetric } from '../../types/report';
interface KPIDashboardProps {
metrics: KPIMetric[];
clinicName?: string;
}
function isNegativeValue(value: string): boolean {
@@ -13,7 +15,8 @@ function isNegativeValue(value: string): boolean {
return lower === '0' || lower.includes('없음') || lower.includes('불가') || lower === 'n/a';
}
export default function KPIDashboard({ metrics }: KPIDashboardProps) {
export default function KPIDashboard({ metrics, clinicName }: KPIDashboardProps) {
const { id } = useParams<{ id: string }>();
const { exportPDF, isExporting } = useExportPDF();
return (
@@ -75,14 +78,14 @@ export default function KPIDashboard({ metrics }: KPIDashboardProps) {
</p>
<div className="flex flex-col sm:flex-row items-center justify-center gap-4">
<a
href="/plan/view-clinic"
href={`/plan/${id || 'live'}`}
className="inline-flex items-center gap-2 bg-gradient-to-r from-[#4F1DA1] to-[#021341] text-white font-semibold px-8 py-4 rounded-full hover:shadow-xl transition-all"
>
마케팅 기획
<ArrowUpRight size={18} />
</a>
<button
onClick={() => exportPDF('INFINITH_Marketing_Report_뷰성형외과')}
onClick={() => exportPDF(`INFINITH_Marketing_Report_${clinicName || 'Report'}`)}
disabled={isExporting}
className="inline-flex items-center gap-2 bg-white border border-slate-200 text-[#021341] font-semibold px-8 py-4 rounded-full hover:bg-slate-50 shadow-sm hover:shadow-md transition-all disabled:opacity-60 disabled:cursor-not-allowed"
>