import { motion } from 'motion/react'; import { Calendar, Users, MapPin, Phone, Award, Star, Globe, ExternalLink, Building2 } from 'lucide-react'; import { SectionWrapper } from './ui/SectionWrapper'; import type { ClinicSnapshot as ClinicSnapshotType } from '../../types/report'; interface ClinicSnapshotProps { data: ClinicSnapshotType; } function formatNumber(n: number): string { return n.toLocaleString(); } interface InfoField { label: string; value: string; icon: typeof Calendar; href?: string; } const infoFields = (data: ClinicSnapshotType): InfoField[] => [ data.established ? { label: '개원', value: `${data.established} (${data.yearsInBusiness}년)`, icon: Calendar } : null, data.staffCount > 0 ? { label: '전문의', value: `${data.staffCount}명`, icon: Users } : null, data.overallRating > 0 ? { label: '강남언니 평점', value: data.overallRating > 5 ? `${data.overallRating} / 10` : `${data.overallRating} / 5.0`, icon: Star } : null, data.totalReviews > 0 ? { label: '리뷰 수', value: formatNumber(data.totalReviews), icon: Star } : null, data.registryData?.district ? { label: '지역구', value: data.registryData.district, icon: Building2 } : null, data.location ? { label: '위치', value: data.nearestStation ? `${data.location} (${data.nearestStation})` : data.location, icon: MapPin } : null, data.phone ? { label: '전화', value: data.phone, icon: Phone, href: `tel:${data.phone.replace(/[^+0-9]/g, '')}` } : null, data.domain ? { label: '도메인', value: data.domain, icon: Globe, href: `https://${data.domain.replace(/^https?:\/\//, '')}` } : null, data.registryData?.websiteEn ? { label: '영문 사이트', value: data.registryData.websiteEn, icon: Globe, href: data.registryData.websiteEn } : null, ].filter(Boolean) as InfoField[]; export default function ClinicSnapshot({ data }: ClinicSnapshotProps) { const fields = infoFields(data); const isVerified = data.source === 'registry'; return ( {/* 외부 검증 배지는 내부 관리용이므로 리포트에서 제외 */} {/* Registry 외부 링크 (강남언니, 네이버 플레이스, 구글 맵) */} {isVerified && (data.registryData?.naverPlaceUrl || data.registryData?.gangnamUnniUrl || data.registryData?.googleMapsUrl) && ( {data.registryData?.gangnamUnniUrl && ( 강남언니 )} {data.registryData?.naverPlaceUrl && ( 네이버 플레이스 )} {data.registryData?.googleMapsUrl && ( Google Maps )} )}
{fields.map((field, i) => { const Icon = field.icon; return (

{field.label}

{field.href ? ( {field.value} {!field.href.startsWith('tel:') && } ) : (

{field.value}

)}
); })}
{/* Lead Doctor Highlight — only show if doctor name exists */} {data.leadDoctor.name && (

대표 원장

{data.leadDoctor.name}

{data.leadDoctor.credentials && (

{data.leadDoctor.credentials}

)} {data.leadDoctor.rating > 0 && (
{Array.from({ length: 5 }).map((_, i) => ( ))} {data.leadDoctor.rating}
{data.leadDoctor.reviewCount > 0 && ( 리뷰 {formatNumber(data.leadDoctor.reviewCount)}건 )}
)}
)} {/* Certifications */} {data.certifications.length > 0 && (

인증 및 자격

{data.certifications.map((cert) => ( {cert} ))}
)}
); }