// ============================================================
// vibn-marketplace · marketplace-shells.jsx
// ------------------------------------------------------------
// Layout shells for marketplace pages.
//
// MarketplaceTopShell — public, transparent-on-scroll top
// nav with brand left, links center, host-mode toggle and
// avatar right. Compact variant shrinks the SearchBar.
//
// DashboardShell — left sidebar with side switch (Guest /
// Host modes), workspace, nav sections.
// ============================================================
// ── MarketplaceTopShell ──────────────────────────────────────
// Props:
// brand { name, mark }
// showSearch bool — inline SearchBar in the header
// searchProps { destination, dates, guests }
// user { name, color, role }
// onHostMode fn — called when user clicks "Switch to hosting"
// compact bool — slimmer header (e.g. for non-home pages)
const MarketplaceTopShell = ({
brand = { name: "Atlas" },
showSearch, searchProps = {},
user, onHostMode = () => {},
compact, children,
footer = true,
}) => (
{children}
{footer && (
)}
);
// Brand mark for the Atlas marketplace — a stylized compass-ish glyph
const AtlasMark = ({ size = 26 }) => (
);
// ── MarketplaceDashboardShell ────────────────────────────────
// Side nav for the demand (guest) and supply (host) dashboards.
// role "guest" | "host"
// active id of current nav item
// onRoleSwitch fn
const MarketplaceDashboardShell = ({
brand = { name: "Atlas" },
role = "guest",
active,
onRoleSwitch = () => {},
user,
children,
}) => {
const guestNav = [
{ id: "trips", label: "My trips", icon: "briefcase" },
{ id: "saved", label: "Saved", icon: "star" },
{ id: "inbox", label: "Messages", icon: "inbox", count: 3 },
{ id: "_account", section: "Account" },
{ id: "profile", label: "Profile", icon: "people" },
{ id: "payment", label: "Payments", icon: "doc" },
{ id: "settings", label: "Settings", icon: "settings" },
];
const hostNav = [
{ id: "today", label: "Today", icon: "home" },
{ id: "calendar", label: "Calendar", icon: "check" },
{ id: "listings", label: "Listings", icon: "building", count: 3 },
{ id: "earnings", label: "Earnings", icon: "bar" },
{ id: "inbox", label: "Inbox", icon: "inbox", count: 5 },
{ id: "_growth", section: "Growth" },
{ id: "insights", label: "Insights", icon: "spark" },
{ id: "reviews", label: "Reviews", icon: "star" },
{ id: "_account", section: "Account" },
{ id: "profile", label: "Profile", icon: "people" },
{ id: "payouts", label: "Payouts", icon: "doc" },
{ id: "settings", label: "Settings", icon: "settings" },
];
const nav = role === "host" ? hostNav : guestNav;
return (
{children}
);
};
Object.assign(window, {
MarketplaceTopShell, MarketplaceDashboardShell, AtlasMark,
});