// Shared components for Hessa Falasi prototype const { useState, useEffect, useRef } = React; const WA_LINK = "https://wa.me/971526404072?text=Hi%20Hessa%20Falasi%2C%20I%27d%20like%20to%20book%20a%20styling%20appointment"; function formatAED(amount, locale) { // Use English digits regardless of locale for prices (luxury convention), // but allow Arabic-Indic via locale conversion if requested. const n = amount.toLocaleString("en-US"); return `AED ${n}`; } function PriceBlock({ p, locale }) { const t = window.HF_USE_T(locale); return ( {p.priceFrom ? {t("common.from")} : null} {formatAED(p.priceAED)} ); } function Navbar({ route, locale, setLocale, navigate, dark }) { const t = window.HF_USE_T(locale); const [openMenu, setOpenMenu] = useState(false); const [showColl, setShowColl] = useState(false); const links = [ { id: "collections", label: t("nav.collections"), href: "#/collections" }, { id: "house", label: t("nav.house"), href: "#/the-house" }, { id: "press", label: t("nav.press"), href: "#/press" }, { id: "visit", label: t("nav.visit"), href: "#/visit" } ]; const isActive = (id) => route.path.startsWith("/" + id) || (id === "collections" && route.path.startsWith("/collection")); return ( ); } function Footer({ locale }) { const t = window.HF_USE_T(locale); return ( ); } function SectionHead({ num, title, meta }) { return (
{num}

{title}

{meta}
); } function ProductCard({ p, locale, navigate, badge }) { const t = window.HF_USE_T(locale); return (
navigate("#/product/" + p.handle)} role="button" tabIndex={0}>
{p.name[locale]} {badge ? {badge.text} : null}
{p.name[locale]}
{t(`silhouettes.${p.silhouette}`) || ""} · {p.collection.toUpperCase()}
); } function CollectionCard({ c, locale, span, num }) { return ( {c.name[locale]} {num}
{c.tag[locale]}{c.seasonal ? " · " + (locale==="ar"?"موسمي":"Seasonal") : ""}
{c.name[locale]}
); } function Toast({ message, onDone }) { useEffect(() => { if (!message) return; const t = setTimeout(onDone, 2400); return () => clearTimeout(t); }, [message]); if (!message) return null; return
{message}
; } function WhatsAppFab({ locale }) { const t = window.HF_USE_T(locale); return ( {locale === "ar" ? "واتساب" : "WhatsApp us"} ); } Object.assign(window, { WA_LINK, formatAED, PriceBlock, Navbar, Footer, SectionHead, ProductCard, CollectionCard, Toast, WhatsAppFab });