/* =========================================================
M-FLOW — UI primitives + icons
========================================================= */
const { useState, useEffect, useRef } = React;
/* ICONS — minimal line, all 24x24 viewBox ------------------ */
function Icon({ name, size = 18 }) {
const props = {
width: size,
height: size,
viewBox: "0 0 24 24",
fill: "none",
stroke: "currentColor",
strokeWidth: 1.5,
strokeLinecap: "round",
strokeLinejoin: "round",
};
const paths = {
arrow: ,
arrowUpRight: ,
plus: ,
check: ,
whatsapp: (
),
shield: (
),
pulse: ,
fingerprint: (
),
zap: ,
loop: ,
cpu: (
),
layers: ,
compass: (
),
target: (
),
node: (
),
clock: (
),
chat: ,
};
return ;
}
/* BRAND --------------------------------------------------- */
function Brand() {
return (
M-FLOW
/eng
);
}
/* STATUS PILL --------------------------------------------- */
function StatusPill({ children }) {
return (
{children}
);
}
/* HEADER -------------------------------------------------- */
function SiteHeader({ onContactClick }) {
const [scrolled, setScrolled] = useState(false);
useEffect(() => {
const onScroll = () => setScrolled(window.scrollY > 24);
onScroll();
window.addEventListener("scroll", onScroll, { passive: true });
return () => window.removeEventListener("scroll", onScroll);
}, []);
return (
);
}
/* REVEAL hook --------------------------------------------- */
function useReveal() {
const ref = useRef(null);
useEffect(() => {
const el = ref.current;
if (!el) return;
const io = new IntersectionObserver(
(entries) => {
entries.forEach((e) => {
if (e.isIntersecting) {
e.target.classList.add("in");
io.unobserve(e.target);
}
});
},
{ threshold: 0.12, rootMargin: "0px 0px -10% 0px" }
);
el.querySelectorAll(".reveal").forEach((c) => io.observe(c));
return () => io.disconnect();
}, []);
return ref;
}
/* SECTION HEADER ------------------------------------------ */
function SectionHead({ eyebrow, title, aside, num }) {
return (
{title}
{aside &&
{aside}
}
);
}
/* WHATSAPP FLOAT ----------------------------------------- */
function WhatsAppFloat({ phone }) {
const href = `https://wa.me/${phone.replace(/\D/g, "")}`;
return (
Falar agora
);
}
/* expose to global scope */
Object.assign(window, {
Icon, Brand, StatusPill, SiteHeader, SectionHead, useReveal, WhatsAppFloat,
});