/* DigiHealthCloud — single-page React app, no build step.
*
* Copy lives in data/site-content.json (edit that to change wording)
* Scraped numbers live in data/market-intel.json (written by scrapers/, don't hand-edit)
*/
const { useState, useEffect } = React;
/* ------------------------------------------------------------------ icons */
const Icon = ({ name }) => {
const paths = {
app: <> >,
voice: <> >,
shield: <> >,
chart: <> >,
};
return (
{paths[name] || paths.app}
);
};
/* --------------------------------------------------------------- waveform */
/* Decorative audio waveform — the voice-capture motif. */
const Waveform = () => {
const bars = 96;
const w = 1200, h = 88, gap = w / bars;
return (
{Array.from({ length: bars }, (_, i) => {
const t = i / bars;
const amp = (Math.sin(t * 22) * 0.4 + Math.sin(t * 7.3) * 0.35 + Math.sin(t * 3.1) * 0.25);
const bh = Math.max(3, Math.abs(amp) * (h * 0.72));
return (
);
})}
);
};
/* ----------------------------------------------------------------- header */
const Header = () => (
);
/* ------------------------------------------------------------------- hero */
const Hero = ({ c }) => (
{c.eyebrow}
{c.headline}
{c.subhead}
);
/* -------------------------------------------------------------- what we build */
const WhatWeBuild = ({ c }) => (
{c.items.map((it, i) => (
))}
);
/* --------------------------------------------------------------- how it works */
const HowItWorks = ({ c }) => (
{c.steps.map((s, i) => (
))}
);
/* ------------------------------------------------- market pulse (scraped data) */
const MarketPulse = ({ data }) => {
// Hidden until the scraper has produced real data — no placeholder numbers.
if (!data || !(data.stats || []).length) return null;
return (
Market pulse
Updated automatically from the public ClinicalTrials.gov registry — no manual editing.
{(data.stats || []).map((s, i) => (
))}
Last updated {data.updatedAt ? new Date(data.updatedAt).toLocaleDateString('en-US',
{ year: 'numeric', month: 'long', day: 'numeric' }) : '—'} · Source: ClinicalTrials.gov
);
};
/* ---------------------------------------------------------------- contact */
const Contact = ({ c }) => {
const [form, setForm] = useState({ name: '', email: '', message: '' });
const set = (k) => (e) => setForm({ ...form, [k]: e.target.value });
// No backend yet: this opens the visitor's email client with the message filled in.
// Swap for a real endpoint (Formspree, Hostinger PHP mailer) when you want one.
const submit = (e) => {
e.preventDefault();
const subject = encodeURIComponent(`Inquiry from ${form.name || 'website visitor'}`);
const body = encodeURIComponent(`${form.message}\n\n— ${form.name}\n${form.email}`);
window.location.href = `mailto:${c.email}?subject=${subject}&body=${body}`;
};
return (
);
};
const Footer = () => (
);
/* -------------------------------------------------------------------- app */
const App = () => {
const [content, setContent] = useState(null);
const [intel, setIntel] = useState(null);
useEffect(() => {
fetch('data/site-content.json').then(r => r.json()).then(setContent).catch(() => {});
fetch('data/market-intel.json').then(r => r.json()).then(setIntel).catch(() => {});
}, []);
if (!content) return null;
return (
<>
>
);
};
ReactDOM.createRoot(document.getElementById('root')).render( );