import React from 'react';
import { I } from '../icons.jsx';
import { CLINIC_DATA } from '../data.js';
import { Avatar, AppointmentCard, SectionHeader } from '../components.jsx';
export function HomeCardsScreen({ nav }) {
const { doctors, appointments, specializations, clinic, articles } = CLINIC_DATA;
const upcoming = appointments.find(a => a.status === 'upcoming');
const upDoc = upcoming && doctors.find(d => d.id === upcoming.doctor);
return (
Добрый день,
Анна Сергеевна
{upcoming && upDoc && (
nav.set('appts')} />
a.id === upcoming.address)} onClick={() => nav.push('appt:' + upcoming.id)} />
)}
{specializations.map(s => {
const icons = { ear: I.ear, hear: I.hearing, leaf: I.heart, mic: I.mic, baby: I.profile, scalpel: I.stetho };
const Ic = icons[s.icon];
return (
);
})}
nav.push('articles')} />
{articles.map((a, i) => (
))}
);
}
export function HomeListScreen({ nav }) {
const { doctors, appointments, clinic } = CLINIC_DATA;
const upcoming = appointments.find(a => a.status === 'upcoming');
const upDoc = upcoming && doctors.find(d => d.id === upcoming.doctor);
const items = [
{ id: 'book', icon: I.plus, title: 'Записаться на приём', sub: 'ЛОР, сурдолог, фониатр', tint: 'var(--c-primary-darker)', bg: 'var(--c-primary-100)', cta: true, go: 'booking-specs' },
{ id: 'appt', icon: I.calendar, title: 'Мои приёмы', sub: `${appointments.filter(a=>a.status==='upcoming').length} предстоящих · ${appointments.filter(a=>a.status==='past').length} прошедших`, go: 'appts' },
{ id: 'card', icon: I.file, title: 'Медицинская карта', sub: 'История, результаты, заключения', go: 'medcard' },
{ id: 'results', icon: I.doc, title: 'Анализы и обследования', sub: '5 результатов · 1 в работе', go: 'results' },
{ id: 'telemed', icon: I.video, title: 'Видеоконсультация', sub: 'Онлайн с ЛОР-врачом', go: 'telemed' },
{ id: 'audio', icon: I.hearing, title: 'Тест слуха', sub: 'Аудиограмма за 3 минуты', go: 'audiotest' },
{ id: 'recovery', icon: I.shield, title: 'Восстановление', sub: 'Септопластика · день 6', go: 'recovery' },
{ id: 'chat', icon: I.chat, title: 'Чат с врачом', sub: '2 непрочитанных', badge: 2, go: 'chat' },
];
return (
Здравствуйте,
Анна Сергеевна
{upcoming && upDoc && (
a.id===upcoming.address)} onClick={() => nav.push('appt:' + upcoming.id)} compact />
)}
{items.map((it, i) => (
{i < items.length - 1 && }
))}
);
}
export function HomeTimelineXScreen({ nav }) {
const { doctors, appointments, clinic, articles, chronic } = CLINIC_DATA;
const upcoming = appointments.find(a => a.status === 'upcoming');
const upDoc = upcoming && doctors.find(d => d.id === upcoming.doctor);
const myDoctor = doctors.find(d => d.id === chronic.doctorId);
const typeColors = {
diagnosis: { bg: 'var(--c-primary-100)', fg: 'var(--c-primary-darker)' },
procedure: { bg: 'var(--c-primary-100)', fg: 'var(--c-primary-darker)' },
therapy: { bg: 'var(--c-warm-100)', fg: 'var(--c-warm-text)' },
flareup: { bg: 'var(--c-accent-50)', fg: 'var(--c-accent)' },
checkup: { bg: 'var(--c-success-50)', fg: 'var(--c-success)' },
};
return (
{/* Greeting header */}
20 апреля, понедельник
Здравствуйте, Анна
{/* Health status hero */}
Ваше состояние
{chronic.stage}
{chronic.condition}
Наблюдение с {chronic.diagnosed} · {myDoctor.name.split(' ').slice(0, 2).join(' ')}
{chronic.daysSinceLastFlareup}
дней без обострений
{chronic.complianceScore}%
комплаенс
{chronic.flareupsThisYear}
обострение в году
{/* Current tasks */}
nav.push('medcard')} />
{chronic.currentTasks.map((t, i, a) => {
const isDaily = t.type === 'daily';
return (
{isDaily ? (
{t.done && }
) : (
)}
{t.text}
{isDaily ? (t.streak > 0 ? `Серия: ${t.streak} дней` : 'Ежедневно') : `До ${t.nextDate}`}
{isDaily && t.streak > 0 &&
🔥}
{!isDaily &&
}
{i < a.length - 1 && }
);
})}
{/* Promotion: ask AI or doctor */}
{/* History timeline */}
nav.push('medcard')} />
{chronic.pastVisits.map((v, i, a) => {
const d = doctors.find(x => x.id === v.doctorId);
const c = typeColors[v.type] || typeColors.checkup;
const isLast = i === a.length - 1;
return (
{!isLast && (
)}
{d.init}
{v.title}
{v.date} · {d.name.split(' ').slice(0, 2).join(' ')}
);
})}
{/* Upcoming appointment */}
{upcoming && upDoc && (
a.id === upcoming.address)} onClick={() => nav.push('appt:' + upcoming.id)} />
)}
{/* Recommendations */}
{chronic.recommendations.map((r, i) => (
{r.icon}
{r.title}
{r.sub}
))}
{/* Book CTA */}
{/* Articles */}
nav.push('articles')} />
{articles.slice(0, 3).map(a => (
))}
);
}
export function HomeSplashScreen({ nav }) {
const { patient, doctors, appointments, articles } = CLINIC_DATA;
const firstName = patient.shortName.split(' ')[0];
const upcoming = appointments.find(a => a.status === 'upcoming');
const upDoc = upcoming && doctors.find(d => d.id === upcoming.doctor);
const article = articles[0];
return (
Добрый день, {firstName}!
Записи на прием
{upcoming && upDoc && (
)}
Услуги и консультации
nav.push('booking-specs')} />
nav.set('chat')} />
Полезная информация
nav.push('article:' + article.id)} />
nav.push('articles')} />
nav.push('prices')} />
nav.push('contacts')} />
);
}
function SplashTile({ icon: Ic, sub, main, onClick }) {
return (
);
}
export function HomeFeedScreen({ nav }) {
const { doctors, appointments, clinic, articles, recovery } = CLINIC_DATA;
const upcoming = appointments.find(a => a.status === 'upcoming');
const upDoc = upcoming && doctors.find(d => d.id === upcoming.doctor);
return (
18 апреля, суббота
Как Ваше самочувствие?
Амоксиклав 625 мг
Принять в 20:00 — через 2 часа
{upcoming && upDoc && (
<>
a.id===upcoming.address)} onClick={() => nav.push('appt:' + upcoming.id)} />
>
)}
nav.push('articles')} pad="0 0 0 0" />
{articles.slice(0,3).map((a)=>(
))}
);
}