/* Royal Yachts — shared UI primitives */
const { useState, useEffect, useRef, useMemo } = React;
/* ---------- Icons ---------- */
const Icon = {
arrow: (props) => (
),
arrowR: (props) => (
),
close: (props) => (
),
heart: (filled, props = {}) => (
),
wa: (props) => (
),
call: (props) => (
),
check: (props) => (
),
ruler: (props) => (
),
guests: (props) => (
),
};
/* ---------- Logo (as inline img — already vector svg in /media) ---------- */
function Logo({ dark }) {
return (
);
}
/* ---------- Nav ---------- */
function Nav({ lang, setLang, onEnquire, t }) {
return (
);
}
/* ---------- Hero ---------- */
function Hero({ t, onEnquire }) {
const [live, setLive] = useState(false);
useEffect(() => { const id = setTimeout(() => setLive(true), 80); return () => clearTimeout(id); }, []);
return (
);
}
/* ---------- Trust strip ---------- */
function TrustStrip({ t }) {
return (
{t.trustService}
{t.trustBody}
{t.trustReach}
{t.trustReachBody}
Member
Leisure Marine Association
);
}
/* ---------- Dual entry ---------- */
function DualEntry({ onCharter, onSales, t }) {
return (
01 · For the day, for the week
Charter a yacht.
From a four-hour sunset out of Dubai Marina to a fortnight on the Adriatic. Quote, route and crew — handled by one team.
02 · For the long haul
Buy, build & own.
Brokerage, new-build commissioning, co-ownership programmes and full management — the lifecycle of an asset that floats.
);
}
/* ---------- Yacht card ---------- */
function YachtCard({ y, faved, onFave, onOpen, onEnquire, idx }) {
return (
onOpen(y)}>
{String(idx + 1).padStart(2, "0")} · {y.builder}
{y.name}
{y.year}
{y.length} ft
{y.guests} guests
{y.cabins} cabins
{y.crew} crew
On request
);
}
/* ---------- Experience grid ---------- */
function ExperienceGrid({ exps, onEnquire }) {
return (
{exps.map((e) => (
onEnquire({ intent: "experience", experienceId: e.id })}
>
{e.tag}
{e.title}
Enquire
))}
);
}
/* ---------- Destinations rail ---------- */
function DestinationRail({ dests, onEnquire }) {
return (
{dests.map((d, i) => (
onEnquire({ intent: "destination", destinationId: d.id })}>
{String(i + 1).padStart(2, "0")} / {String(dests.length).padStart(2, "0")} · {d.region}
{d.name}
{d.duration}
{d.pitch}
))}
);
}
Object.assign(window, {
Icon, Logo, Nav, Hero, TrustStrip, DualEntry, YachtCard, ExperienceGrid, DestinationRail
});