// Page sections for НАЦЗДРАВ const { useState: useS, useEffect: useE, useRef: useR, useMemo: useM } = React; // ============ HERO ============ const Hero = ({ onBook, onSecondOpinion }) => { return (
Центр сложных клинических случаев

{DATA.hero.headline.map((line, i) => ( {line} ))}

{DATA.hero.sub}

{DATA.hero.badges.map((b, i) => (
{b.title}
{b.note}
))}
Фасад здания НАЦЗДРАВ
); }; // ============ QUICK SEARCH (with autocomplete) ============ const QuickSearch = () => { const [active, setActive] = useS(null); // 'service' | 'direction' | 'doctor' | null const [query, setQuery] = useS(''); const [selection, setSelection] = useS({ service: '', direction: '', doctor: '' }); const ref = useR(null); useE(() => { const onClick = (e) => { if (ref.current && !ref.current.contains(e.target)) setActive(null); }; document.addEventListener('mousedown', onClick); return () => document.removeEventListener('mousedown', onClick); }, []); const options = useM(() => { if (active === 'service') return DATA.services; if (active === 'direction') return DATA.directions.map(d => d.name); if (active === 'doctor') return DATA.doctors.map(d => `${d.fullName} — ${d.specs[0]}`); return []; }, [active]); const filtered = useM(() => { if (!query.trim()) return options.slice(0, 8); const q = query.toLowerCase(); return options.filter(o => o.toLowerCase().includes(q)).slice(0, 8); }, [options, query]); const fields = [ { key: 'service', label: 'Услуга', placeholder: 'Найти услугу', icon: 'pill' }, { key: 'direction', label: 'Направление', placeholder: 'Выбрать направление', icon: 'stethoscope' }, { key: 'doctor', label: 'Врач', placeholder: 'Найти врача', icon: 'doctor' }, ]; const handlePick = (val) => { setSelection({ ...selection, [active]: val }); setActive(null); setQuery(''); }; return ( ); }; // ============ DIRECTIONS (Centers of competence) ============ const Directions = ({ onBook }) => { return (
Все направления } />
{DATA.directions.slice(0, 12).map((d) => (

{d.name}

{d.desc}

Подробнее
))}
); }; // ============ DOCTORS ============ const Doctors = ({ onBook }) => { const scrollerRef = useR(null); const scroll = (dir) => { const el = scrollerRef.current; if (!el) return; el.scrollBy({ left: dir * 360, behavior: 'smooth' }); }; // Если врачей ещё нет — секцию на главной не показываем if (!DATA.doctors || DATA.doctors.length === 0) return null; return (
Все врачи
} />
{DATA.doctors.map((doc) => ( ))}
); }; Object.assign(window, { Hero, QuickSearch, Directions, Doctors });