/* Shared primitives for ZenTag landing */
const { useEffect, useRef, useState, useMemo, useCallback } = React;
// ----- Reveal-on-scroll hook -----
function useReveal(opts = {}) {
const ref = useRef(null);
useEffect(() => {
const el = ref.current;
if (!el) return;
const io = new IntersectionObserver((entries) => {
entries.forEach((e) => {
if (e.isIntersecting) {
el.classList.add('in');
io.unobserve(el);
}
});
}, { threshold: opts.threshold ?? 0.12, rootMargin: opts.rootMargin ?? '0px 0px -8% 0px' });
io.observe(el);
return () => io.disconnect();
}, []);
return ref;
}
// ----- Reveal wrapper -----
function Reveal({ as = 'div', delay = 0, className = '', children, ...rest }) {
const ref = useReveal();
const Tag = as;
const delayClass = delay ? `reveal-delay-${delay}` : '';
return (
{children}
);
}
// ----- Section header -----
function Eyebrow({ children, className = '' }) {
return (
{children}
);
}
function SectionTitle({ eyebrow, title, sub, align = 'left', children }) {
const alignCls = align === 'center' ? 'text-center items-center mx-auto' : 'text-left items-start';
return (
{eyebrow &&
{eyebrow}}
{title}
{sub && (
{sub}
)}
{children}
);
}
// ----- Buttons -----
function PrimaryBtn({ children, icon, className = '', href, ...rest }) {
const inner = (
<>
{children}
{icon !== false && (
)}
>
);
if (href) {
return {inner};
}
return ;
}
function GhostBtn({ children, className = '', href, ...rest }) {
if (href) {
return {children};
}
return ;
}
// ----- Aurora background -----
function Aurora({ intensity = 1 }) {
return (
);
}
// ----- Icons (inline, minimal) -----
const Icon = {
Instagram: (p) => (),
LinkedIn: (p) => (),
Twitter: (p) => (),
TikTok: (p) => (),
WhatsApp: (p) => (),
Facebook: (p) => (),
YouTube: (p) => (),
NFC: (p) => (),
QR: (p) => (),
Spark: (p) => (),
Check: (p) => (),
Arrow: (p) => (),
Leaf: (p) => (),
Wallet: (p) => (),
Users: (p) => (),
Chart: (p) => (),
Calendar: (p) => (),
Video: (p) => (),
Link: (p) => (),
Cloud: (p) => (),
AI: (p) => (),
Resume: (p) => (),
Phone: (p) => (),
Sync: (p) => (),
Globe: (p) => (),
Lead: (p) => (),
};
// ----- Social row -----
const SocialList = [
{ name: 'Instagram', Comp: Icon.Instagram, color: '#E1306C' },
{ name: 'LinkedIn', Comp: Icon.LinkedIn, color: '#0A66C2' },
{ name: 'TikTok', Comp: Icon.TikTok, color: '#fff' },
{ name: 'X', Comp: Icon.Twitter, color: '#fff' },
{ name: 'WhatsApp', Comp: Icon.WhatsApp, color: '#25D366' },
{ name: 'Facebook', Comp: Icon.Facebook, color: '#1877F2' },
{ name: 'YouTube', Comp: Icon.YouTube, color: '#FF0033' },
];
Object.assign(window, {
useReveal, Reveal, Eyebrow, SectionTitle,
PrimaryBtn, GhostBtn, Aurora, Icon, SocialList,
});