import { useState, useEffect } from 'react'; import { useParams } from 'react-router'; import { motion } from 'motion/react'; import { YoutubeFilled, InstagramFilled, FacebookFilled, GlobeFilled, } from '../components/icons/FilledIcons'; import { MapPin, Phone, Clock, Award, ShieldCheck, Star, ExternalLink, Users, Video, MessageSquare, ChevronRight, Camera, BadgeCheck, Building2, GraduationCap, Stethoscope, Heart, TrendingUp, } from 'lucide-react'; import { fetchReportById } from '../lib/supabase'; // ─── 기본값 (DB 데이터로 덮어쓸 수 있음) ─── const CLINIC: Record = { name: '뷰성형외과의원', nameEn: 'VIEW Plastic Surgery', logo: '/assets/clients/view-clinic/logo-circle.png', brandColor: '#7B2D8E', established: 2005, location: '서울 강남구 봉은사로 107 뷰성형외과 빌딩', nearestStation: '9호선 신논현역 3번 출구 도보 1분', phone: '02-539-1177', hours: [ { day: '월~목', time: '10:00 – 19:00' }, { day: '금요일', time: '10:00 – 21:00' }, { day: '토요일', time: '10:00 – 17:00' }, { day: '일/공휴일', time: '휴진' }, ], specialties: ['가슴성형', '안면윤곽', '양악', '눈성형', '코성형', '지방흡입', '리프팅', '피부시술', '필러/보톡스'], certifications: [ '수술실 CCTV 운영', '전담 마취과 전문의 상주', '입원실 완비', '의료진 실명 공개', '응급 대응 체계', '분야별 공동 진료', '전용 휴식 공간', '시술 후 관리', '야간 진료', '여성 의사 진료', ], mediaAppearances: ['렛미인 TV 출연', '보건복지부장관 표창 수상', '안면윤곽 대상 수상', '모티바 사용량 1위'], websites: [ { label: '공식 홈페이지', url: 'viewclinic.com', primary: true }, { label: '영문 사이트', url: 'viewplasticsurgery.com', primary: false }, ], socialChannels: [ { platform: 'YouTube', handle: '@ViewclinicKR', url: 'youtube.com/@ViewclinicKR', followers: '103K 구독자', videos: '1,064개 영상', icon: YoutubeFilled, color: '#FF0000' }, { platform: 'Instagram KR', handle: '@viewplastic', url: 'instagram.com/viewplastic', followers: '14K 팔로워', videos: '1,409 게시물', icon: InstagramFilled, color: '#E1306C' }, { platform: 'Instagram EN', handle: '@view_plastic_surgery', url: 'instagram.com/view_plastic_surgery', followers: '68.8K 팔로워', videos: '2,524 게시물', icon: InstagramFilled, color: '#E1306C' }, { platform: 'Facebook', handle: 'View Plastic Surgery', url: 'facebook.com/viewclinic', followers: '88K 팔로워', videos: '', icon: FacebookFilled, color: '#1877F2' }, { platform: '카카오톡', handle: '뷰성형외과의원', url: 'pf.kakao.com/_xbtVxjl', followers: '상담 채널', videos: '', icon: MessageSquare as any, color: '#FEE500' }, ], }; // ─── 의료진 ─── const DOCTORS: Record[] = [ { name: '최순우', title: '대표원장', specialty: '가슴성형', credentials: '서울대 출신, 의학박사', rating: 9.4, reviews: 1812, featured: true }, { name: '정재현', title: '원장', specialty: '가슴성형', credentials: '성형외과 전문의', rating: 9.6, reviews: 3177, featured: false }, { name: '김정민', title: '원장', specialty: '리프팅 · 눈성형', credentials: '성형외과 전문의', rating: 9.7, reviews: 878, featured: false }, { name: '윤창운', title: '원장', specialty: '안면윤곽 · 양악', credentials: '성형외과 전문의', rating: 9.6, reviews: 764, featured: false }, { name: '조진우', title: '원장', specialty: '리프팅 · 지방 · 눈코', credentials: '성형외과 전문의', rating: 9.6, reviews: 1624, featured: false }, { name: '김도형', title: '원장', specialty: '눈성형 · 코성형', credentials: '성형외과 전문의', rating: 9.7, reviews: 191, featured: false }, ]; // ─── 플랫폼별 평점 ─── const RATINGS: Record[] = [ { platform: '강남언니', rating: '9.5', scale: '/10', reviews: '18,961건', color: '#FF6B8A', pct: 95 }, { platform: '네이버 플레이스', rating: '4.6', scale: '/5', reviews: '324건', color: '#03C75A', pct: 92 }, { platform: 'Google Maps', rating: '4.3', scale: '/5', reviews: '187건', color: '#4285F4', pct: 86 }, ]; // ─── 시술 가격 (강남언니 실제 데이터) ─── const PROCEDURES = [ { name: '가슴성형 (보형물)', price: '₩2,650,000~', category: '가슴' }, { name: '모티바 가슴성형', price: '₩11,550,000~', category: '가슴' }, { name: '눈성형 (매몰/절개)', price: '₩440,000~', category: '눈' }, { name: '코성형', price: '₩990,000~', category: '코' }, { name: '안면윤곽', price: '₩3,289,000~', category: '윤곽' }, { name: '지방흡입', price: '₩1,100,000~', category: '바디' }, { name: '실리프팅', price: '₩1,958,000~', category: '리프팅' }, { name: '필러', price: '₩220,000~', category: '피부' }, ]; // ─── Component ─── export default function ClinicProfilePage() { const { id } = useParams<{ id: string }>(); const [isLoading, setIsLoading] = useState(true); const [error, setError] = useState(null); // Override CLINIC data with DB data when available useEffect(() => { if (!id) { setIsLoading(false); return; } fetchReportById(id) .then((row) => { const report = row.report as Record; const clinicInfo = report.clinicInfo as Record | undefined; const scrapeData = row.scrape_data as Record | undefined; const clinic = (scrapeData?.clinic as Record) || {}; if (clinicInfo?.name) CLINIC.name = clinicInfo.name as string; if (clinicInfo?.address) CLINIC.location = clinicInfo.address as string; if (clinicInfo?.phone) CLINIC.phone = clinicInfo.phone as string; if (clinicInfo?.services) CLINIC.specialties = clinicInfo.services as string[]; if (clinicInfo?.doctors) { const docs = clinicInfo.doctors as { name: string; specialty: string }[]; DOCTORS.length = 0; docs.forEach((d) => { DOCTORS.push({ name: d.name, title: '원장', specialty: d.specialty, credentials: '성형외과 전문의', rating: 0, reviews: 0, featured: false }); }); if (DOCTORS.length > 0) DOCTORS[0].featured = true; } CLINIC.nameEn = (row.clinic_name || '').includes('의원') ? '' : row.clinic_name || ''; // Update website const domain = (() => { try { return new URL(row.url || '').hostname; } catch { return row.url || ''; } })(); CLINIC.websites = [{ label: '공식 홈페이지', url: domain, primary: true }]; // Update social from socialHandles const handles = report.socialHandles as Record | undefined; if (handles) { CLINIC.socialChannels = []; if (handles.instagram) CLINIC.socialChannels.push({ platform: 'Instagram', handle: `@${handles.instagram}`, url: `instagram.com/${handles.instagram}`, followers: '-', videos: '', icon: InstagramFilled, color: '#E1306C' }); if (handles.youtube) CLINIC.socialChannels.push({ platform: 'YouTube', handle: `@${handles.youtube}`, url: `youtube.com/${handles.youtube}`, followers: '-', videos: '', icon: YoutubeFilled, color: '#FF0000' }); if (handles.facebook) CLINIC.socialChannels.push({ platform: 'Facebook', handle: handles.facebook, url: `facebook.com/${handles.facebook}`, followers: '-', videos: '', icon: FacebookFilled, color: '#1877F2' }); } // Update ratings from channel analysis const chAnalysis = report.channelAnalysis as Record> | undefined; if (chAnalysis) { RATINGS.length = 0; if (chAnalysis.gangnamUnni?.rating) { const guRating = chAnalysis.gangnamUnni.rating as number; const guScale = guRating > 5 ? '/10' : '/5'; const guPct = guRating > 5 ? (guRating / 10) * 100 : (guRating / 5) * 100; RATINGS.push({ platform: '강남언니', rating: `${guRating}`, scale: guScale, reviews: `${chAnalysis.gangnamUnni.reviews ?? '-'}건`, color: '#FF6B8A', pct: guPct }); } if (chAnalysis.naverPlace?.rating) RATINGS.push({ platform: '네이버 플레이스', rating: `${chAnalysis.naverPlace.rating}`, scale: '/5', reviews: `${chAnalysis.naverPlace.reviews ?? '-'}건`, color: '#03C75A', pct: ((chAnalysis.naverPlace.rating as number) / 5) * 100 }); } }) .catch((err) => setError(err.message)) .finally(() => setIsLoading(false)); }, [id]); if (isLoading) { return (

병원 프로필을 불러오는 중...

); } if (error) { return (

오류가 발생했습니다

{error}

); } return (
{/* ── Hero / Clinic Header ── */}
{/* Breadcrumb */}
병원 검색 강남구 뷰성형외과
{/* Logo */}
VIEW
{/* Info */}

{CLINIC.name}

{CLINIC.nameEn} · 개원 {CLINIC.established}년 · {new Date().getFullYear() - CLINIC.established}년차

{/* Quick Stats */}
{[ { icon: Star, label: '강남언니 9.5점', sub: '18,961 리뷰' }, { icon: Users, label: `의료진 ${DOCTORS.length}명`, sub: '성형외과 전문의' }, { icon: Video, label: 'YouTube 103K', sub: '1,064 영상' }, ].map((stat) => { const Icon = stat.icon; return (

{stat.label}

{stat.sub}

); })}
{/* ── 기본 정보 카드 ── */}

기본 정보

{CLINIC.location}

{CLINIC.nearestStation}

{CLINIC.phone}

{CLINIC.websites.map(w => ( {w.url} ))}
{CLINIC.hours.map(h => (
{h.day} {h.time}
))}
{/* ── 플랫폼별 통합 평점 ── */}

통합 평점

{RATINGS.map((r, i) => (
{r.platform} {r.reviews}
{r.rating} {r.scale}
))}
{/* ── 의료진 ── */}

의료진 ({DOCTORS.length}명)

{DOCTORS.map((doc, i) => (

{doc.name}

{doc.title} {doc.featured && 대표}

{doc.credentials}

{doc.specialty}
{doc.rating} / 10 · {doc.reviews.toLocaleString()}건
))}
{/* ── 시술 및 가격 ── */}

시술 및 가격

강남언니 기준 · 실제 가격은 상담 후 결정

{PROCEDURES.map((proc, i) => (
{proc.category} {proc.name}
{proc.price}
))}
{/* ── 인증 & 수상 ── */}

인증 및 수상

{CLINIC.certifications.map((cert, i) => ( {cert} ))}
{CLINIC.mediaAppearances.map(m => ( {m} ))}
{/* ── 온라인 채널 ── */}

온라인 채널

{CLINIC.socialChannels.map((ch, i) => { const Icon = ch.icon; return (

{ch.platform}

{ch.handle}

{ch.url}

{ch.followers}

{ch.videos &&

{ch.videos}

}
); })}
{/* ── 데이터 출처 고지 ── */}

데이터 출처:{' '} 본 프로필은 공개된 정보를 자동 수집하여 구성되었습니다. 평점 및 리뷰 수는 강남언니, 네이버 플레이스, Google Maps에서 집계하였으며, 시술 가격은 강남언니 기준입니다. 의료진 정보는 병원 공식 홈페이지 및 강남언니에서 수집하였습니다. 마지막 업데이트: 2026-03-30 · 정보 수정 요청: contact@infinith.io

); }