// ─────────────────────────────────────────────────────────────
// APP — Clínica Digital · Dr. Ulisses Nakagawa
// Home (carrossel) → Lista → Detalhe
// Mesmo template para Suplementos, Manipulados, Peptídeos
// ─────────────────────────────────────────────────────────────
const { useState, useEffect, useRef, useMemo } = React;
// ───────── STICKY AGENDAR (interno, topo da tela) ─────────
// Aparece no topo da Lista e do Detalhe, sticky no scroll.
// NÃO aparece na home (a carrossel já é a ação principal).
function InlineAgendar({ t }) {
return (
Agendar ConsultaCom o Dr. Ulisses Nakagawa
{/* flash de luz que passa na horizontal */}
);
}
// ───────── BOTTOM NAV ─────────
function BottomNav({ active, onChange, t, isLight, onToggleTheme }) {
const items = [
{ id: "home", label: "Início", icon: "home" },
{ id: "consulta", label: "Consulta", icon: "chat" },
{ id: "social", label: "Social", icon: "user" },
];
return (
{items.map((it) => (
))}
{/* ───── BOTÃO MODO CLARO / ESCURO — sempre visível ───── */}
);
}
// ───────── HOME SCREEN ─────────
function HomeScreen({ t, onOpenModule, onBuyModule, onRedeemCode, isUnlocked, frameWidth, frameHeight }) {
return (
{/* HEADER editorial */}
Clínica Digital
Dr. Ulisses
Nakagawa
Médico e Farmacêutico
CRM-MS 16293
Conteúdo educativo · Não substitui consulta médica
{/* Acesso para quem JÁ comprou — discreto, fora do caminho da venda */}
{/* CARROSSEL */}
);
}
// ───────── LIST SCREEN ─────────
function ListScreen({ t, type, onBack, onOpenProduct, density, showVisual }) {
const meta = PRODUCT_TYPES[type];
const products = useMemo(() => PRODUCTS.filter(p => p.type === type), [type]);
const [query, setQuery] = useState("");
const [activeCat, setActiveCat] = useState("Todos");
// Filtros por sessão:
// · Suplementos: Todos · ★ Eu uso · (sem categorias, suplemento age em vários sistemas)
// · Manipulados: Todos · categorias funcionais
// · Peptídeos: Todos · Aprovados · categorias funcionais
const showCats = type !== "suplemento";
const cats = useMemo(() => {
const out = ["Todos"];
if (type === "suplemento" && products.some(p => p.eu_uso)) out.push("★ Eu uso");
if (type === "suplemento") out.push("Referências");
if (type === "peptideo" && products.some(p => p.aprovado)) out.push("Aprovados");
if (showCats) {
const seen = new Set();
products.forEach(p => {
if (!seen.has(p.category)) { seen.add(p.category); out.push(p.category); }
});
}
return out;
}, [products, type, showCats]);
const filtered = useMemo(() => {
return products.filter(p => {
const q = query.toLowerCase().trim();
const matchQ = !q || p.name.toLowerCase().includes(q) || p.tagline.toLowerCase().includes(q);
let matchC = true;
if (activeCat === "Todos") matchC = true;
else if (activeCat === "★ Eu uso") matchC = !!p.eu_uso;
else if (activeCat === "Aprovados") matchC = !!p.aprovado;
else matchC = p.category === activeCat;
return matchQ && matchC;
});
}, [products, query, activeCat]);
return (
)}
{/* FERRAMENTAS — só em Peptídeos */}
{type === "peptideo" && (
Ferramentas
)}
{/* DISCLAIMER LEGAL */}
);
}
// ───────── DETAIL SCREEN ─────────
function DetailScreen({ t, product, onBack }) {
const meta = PRODUCT_TYPES[product.type];
return (
{/* TOPO STICKY — Back + Agendar Consulta */}
{/* HERO */}
{meta.breadcrumb} · {product.category}
{nl2br(product.name)}
{product.tagline}
{/* Apenas o badge "Eu uso" no hero para suplementos (sem pills de classificação aqui — só no rodapé) */}
{product.eu_uso && product.type === "suplemento" && (
★ Eu uso
)}
{/* STATS GRID removido para Manipulados — informação já vive em "Como usar" */}
{false && product.stats && product.type === "manipulado" && (