From 1153e8e78f99eac0a3e4d230827b005afddf3d8c Mon Sep 17 00:00:00 2001 From: Alireza Hassani Date: Sun, 4 Oct 2026 13:21:27 +0330 Subject: [PATCH] Update carousels, card hover, and IranBay branding. Co-authored-by: Cursor --- .env.example | 15 + .gitignore | 40 + AGENTS.md | 9 + CLAUDE.md | 1 + README.md | 78 + app/auth/handoff/layout.tsx | 64 + app/auth/handoff/page.tsx | 31 + app/business/blog/new/page.tsx | 20 + app/business/blog/page.tsx | 35 + app/business/gallery/page.tsx | 27 + app/business/layout.tsx | 14 + app/business/page.tsx | 5 + app/business/portfolios/new/page.tsx | 20 + app/business/portfolios/page.tsx | 38 + app/business/products/categories/page.tsx | 24 + app/business/products/new/page.tsx | 22 + app/business/products/page.tsx | 46 + app/business/profile/page.tsx | 14 + app/businesses/[id]/edit/page.tsx | 24 + app/businesses/[id]/page.tsx | 24 + app/businesses/categories/page.tsx | 18 + app/businesses/page.tsx | 37 + app/customer/layout.tsx | 14 + app/customer/page.tsx | 10 + app/customer/profile/page.tsx | 10 + app/fonts/iranyekan.css | 16 + app/forgot-password/page.tsx | 10 + app/globals.css | 207 + app/layout.tsx | 31 + app/login/page.tsx | 35 + app/manage/[meshkeeId]/blog/new/page.tsx | 20 + app/manage/[meshkeeId]/blog/page.tsx | 33 + app/manage/[meshkeeId]/gallery/page.tsx | 18 + app/manage/[meshkeeId]/layout.tsx | 53 + app/manage/[meshkeeId]/page.tsx | 12 + .../[meshkeeId]/portfolios/new/page.tsx | 20 + app/manage/[meshkeeId]/portfolios/page.tsx | 33 + .../[meshkeeId]/products/categories/page.tsx | 23 + app/manage/[meshkeeId]/products/new/page.tsx | 20 + app/manage/[meshkeeId]/products/page.tsx | 41 + app/manage/[meshkeeId]/profile/page.tsx | 13 + app/page.tsx | 18 + app/website-images/page.tsx | 5 + app/website/blog/categories/page.tsx | 18 + app/website/blog/new/page.tsx | 18 + app/website/blog/page.tsx | 18 + app/website/carousels/page.tsx | 18 + app/website/images/page.tsx | 18 + app/website/special-businesses/page.tsx | 5 + components/AccountMenu.module.css | 77 + components/AccountMenu.tsx | 132 + components/AddBusinessModal.module.css | 351 ++ components/AddBusinessModal.tsx | 619 ++ components/AiPromptPanel.module.css | 149 + components/AiPromptPanel.tsx | 93 + components/AuthFields.tsx | 90 + components/AuthGuards.tsx | 145 + components/AuthProvider.tsx | 278 + components/AuthShell.module.css | 352 ++ components/AuthShell.tsx | 83 + components/BlogCategoriesPage.tsx | 444 ++ components/BusinessCardList.module.css | 584 ++ components/BusinessCardList.tsx | 364 ++ components/BusinessCategoriesPage.module.css | 265 + components/BusinessCategoriesPage.tsx | 431 ++ components/BusinessDetailsPage.module.css | 911 +++ components/BusinessDetailsPage.tsx | 437 ++ components/BusinessShell.tsx | 207 + components/BusinessesPage.module.css | 407 ++ components/BusinessesPage.tsx | 551 ++ components/CategoryTreeSelect.module.css | 235 + components/CategoryTreeSelect.tsx | 283 + components/CategoryTreeView.module.css | 108 + components/CategoryTreeView.tsx | 129 + components/ConfirmDialog.module.css | 135 + components/ConfirmDialog.tsx | 90 + components/CustomerHome.module.css | 109 + components/CustomerHome.tsx | 58 + components/CustomerProfile.tsx | 38 + components/CustomerShell.tsx | 133 + components/DashboardShell.module.css | 367 ++ components/DashboardShell.tsx | 211 + components/EditBusinessPage.module.css | 533 ++ components/EditBusinessPage.tsx | 1109 ++++ components/ForgotPasswordForm.tsx | 35 + components/HomeDashboard.module.css | 331 + components/HomeDashboard.tsx | 332 + components/ImageCropDialog.module.css | 173 + components/ImageCropDialog.tsx | 186 + components/LoginForm.tsx | 319 + components/MakeSpecialModal.module.css | 150 + components/MakeSpecialModal.tsx | 193 + components/RichTextArea.module.css | 226 + components/RichTextArea.tsx | 264 + components/SpecialBusinessesPage.module.css | 479 ++ components/SpecialBusinessesPage.tsx | 514 ++ components/WebsiteBlogForm.module.css | 12 + components/WebsiteBlogForm.tsx | 222 + components/WebsiteBlogListPage.module.css | 254 + components/WebsiteBlogListPage.tsx | 163 + components/WebsiteImagesPage.module.css | 584 ++ components/WebsiteImagesPage.tsx | 838 +++ components/WebsiteLinkGenerator.module.css | 183 + components/WebsiteLinkGenerator.tsx | 221 + components/business/BusinessPageChrome.tsx | 53 + components/catalog/AddBlogForm.tsx | 258 + components/catalog/AddPortfolioForm.tsx | 288 + components/catalog/AddProductForm.tsx | 273 + components/catalog/BlogPanel.tsx | 197 + components/catalog/CatalogCardControls.tsx | 64 + .../catalog/CatalogCategorySelect.module.css | 221 + components/catalog/CatalogCategorySelect.tsx | 248 + .../catalog/CatalogEmptyState.module.css | 65 + components/catalog/CatalogEmptyState.tsx | 48 + components/catalog/CatalogForm.module.css | 458 ++ components/catalog/CatalogFormFields.tsx | 268 + components/catalog/CatalogPagination.tsx | 65 + components/catalog/GalleryPanel.module.css | 162 + components/catalog/GalleryPanel.tsx | 289 + .../catalog/ManageCategoriesPage.module.css | 174 + components/catalog/ManageCategoriesPage.tsx | 569 ++ components/catalog/PortfoliosPanel.tsx | 202 + components/catalog/ProductsPanel.tsx | 347 ++ components/catalog/SeoMetaFields.module.css | 34 + components/catalog/SeoMetaFields.tsx | 70 + components/catalog/utils.ts | 123 + data/business-nav.ts | 29 + data/customer-nav.ts | 14 + data/home.ts | 141 + eslint.config.mjs | 18 + lib/cellNumber.ts | 22 + lib/cropImage.ts | 87 + lib/faText.tsx | 38 + lib/host.ts | 131 + lib/i18n/en.ts | 106 + lib/managed-business.ts | 29 + lib/meshkee-api.ts | 185 + lib/session-handoff.ts | 100 + lib/userName.ts | 28 + middleware.ts | 112 + next.config.ts | 7 + package-lock.json | 5469 +++++++++++++++++ package.json | 25 + public/fonts/iranyekan/IRANYekanWebLight.ttf | Bin 0 -> 60524 bytes .../fonts/iranyekan/IRANYekanWebRegular.ttf | Bin 0 -> 59452 bytes public/images/auth/ship.png | Bin 0 -> 830785 bytes public/images/icons/add.svg | 5 + public/images/icons/blog.svg | 6 + public/images/icons/calendar.svg | 11 + public/images/icons/category.svg | 5 + public/images/icons/chevron.svg | 5 + public/images/icons/eye.svg | 5 + public/images/icons/facebook.png | Bin 0 -> 12450 bytes public/images/icons/gallery.svg | 5 + public/images/icons/gear.svg | 5 + public/images/icons/home-outline.svg | 5 + public/images/icons/home.svg | 5 + public/images/icons/instagram.png | Bin 0 -> 100746 bytes public/images/icons/logo.png | Bin 0 -> 16362 bytes public/images/icons/menu.svg | 7 + public/images/icons/search.svg | 5 + public/images/icons/telegram.png | Bin 0 -> 12560 bytes public/images/icons/user.svg | 14 + services/auth.ts | 49 + services/marketplace.ts | 117 + services/meshkee-business-ai.ts | 76 + services/meshkee-businesses.ts | 312 + services/meshkee-catalog.ts | 206 + services/meshkee-categories.ts | 124 + services/meshkee-cities.ts | 83 + services/meshkee-content.ts | 285 + services/special-businesses.ts | 76 + services/website-blog.ts | 216 + services/website-media.ts | 133 + styles/ai.module.css | 112 + tsconfig.json | 34 + types/auth.ts | 30 + types/business.ts | 34 + 178 files changed, 30517 insertions(+) create mode 100644 .env.example create mode 100644 .gitignore create mode 100644 AGENTS.md create mode 100644 CLAUDE.md create mode 100644 README.md create mode 100644 app/auth/handoff/layout.tsx create mode 100644 app/auth/handoff/page.tsx create mode 100644 app/business/blog/new/page.tsx create mode 100644 app/business/blog/page.tsx create mode 100644 app/business/gallery/page.tsx create mode 100644 app/business/layout.tsx create mode 100644 app/business/page.tsx create mode 100644 app/business/portfolios/new/page.tsx create mode 100644 app/business/portfolios/page.tsx create mode 100644 app/business/products/categories/page.tsx create mode 100644 app/business/products/new/page.tsx create mode 100644 app/business/products/page.tsx create mode 100644 app/business/profile/page.tsx create mode 100644 app/businesses/[id]/edit/page.tsx create mode 100644 app/businesses/[id]/page.tsx create mode 100644 app/businesses/categories/page.tsx create mode 100644 app/businesses/page.tsx create mode 100644 app/customer/layout.tsx create mode 100644 app/customer/page.tsx create mode 100644 app/customer/profile/page.tsx create mode 100644 app/fonts/iranyekan.css create mode 100644 app/forgot-password/page.tsx create mode 100644 app/globals.css create mode 100644 app/layout.tsx create mode 100644 app/login/page.tsx create mode 100644 app/manage/[meshkeeId]/blog/new/page.tsx create mode 100644 app/manage/[meshkeeId]/blog/page.tsx create mode 100644 app/manage/[meshkeeId]/gallery/page.tsx create mode 100644 app/manage/[meshkeeId]/layout.tsx create mode 100644 app/manage/[meshkeeId]/page.tsx create mode 100644 app/manage/[meshkeeId]/portfolios/new/page.tsx create mode 100644 app/manage/[meshkeeId]/portfolios/page.tsx create mode 100644 app/manage/[meshkeeId]/products/categories/page.tsx create mode 100644 app/manage/[meshkeeId]/products/new/page.tsx create mode 100644 app/manage/[meshkeeId]/products/page.tsx create mode 100644 app/manage/[meshkeeId]/profile/page.tsx create mode 100644 app/page.tsx create mode 100644 app/website-images/page.tsx create mode 100644 app/website/blog/categories/page.tsx create mode 100644 app/website/blog/new/page.tsx create mode 100644 app/website/blog/page.tsx create mode 100644 app/website/carousels/page.tsx create mode 100644 app/website/images/page.tsx create mode 100644 app/website/special-businesses/page.tsx create mode 100644 components/AccountMenu.module.css create mode 100644 components/AccountMenu.tsx create mode 100644 components/AddBusinessModal.module.css create mode 100644 components/AddBusinessModal.tsx create mode 100644 components/AiPromptPanel.module.css create mode 100644 components/AiPromptPanel.tsx create mode 100644 components/AuthFields.tsx create mode 100644 components/AuthGuards.tsx create mode 100644 components/AuthProvider.tsx create mode 100644 components/AuthShell.module.css create mode 100644 components/AuthShell.tsx create mode 100644 components/BlogCategoriesPage.tsx create mode 100644 components/BusinessCardList.module.css create mode 100644 components/BusinessCardList.tsx create mode 100644 components/BusinessCategoriesPage.module.css create mode 100644 components/BusinessCategoriesPage.tsx create mode 100644 components/BusinessDetailsPage.module.css create mode 100644 components/BusinessDetailsPage.tsx create mode 100644 components/BusinessShell.tsx create mode 100644 components/BusinessesPage.module.css create mode 100644 components/BusinessesPage.tsx create mode 100644 components/CategoryTreeSelect.module.css create mode 100644 components/CategoryTreeSelect.tsx create mode 100644 components/CategoryTreeView.module.css create mode 100644 components/CategoryTreeView.tsx create mode 100644 components/ConfirmDialog.module.css create mode 100644 components/ConfirmDialog.tsx create mode 100644 components/CustomerHome.module.css create mode 100644 components/CustomerHome.tsx create mode 100644 components/CustomerProfile.tsx create mode 100644 components/CustomerShell.tsx create mode 100644 components/DashboardShell.module.css create mode 100644 components/DashboardShell.tsx create mode 100644 components/EditBusinessPage.module.css create mode 100644 components/EditBusinessPage.tsx create mode 100644 components/ForgotPasswordForm.tsx create mode 100644 components/HomeDashboard.module.css create mode 100644 components/HomeDashboard.tsx create mode 100644 components/ImageCropDialog.module.css create mode 100644 components/ImageCropDialog.tsx create mode 100644 components/LoginForm.tsx create mode 100644 components/MakeSpecialModal.module.css create mode 100644 components/MakeSpecialModal.tsx create mode 100644 components/RichTextArea.module.css create mode 100644 components/RichTextArea.tsx create mode 100644 components/SpecialBusinessesPage.module.css create mode 100644 components/SpecialBusinessesPage.tsx create mode 100644 components/WebsiteBlogForm.module.css create mode 100644 components/WebsiteBlogForm.tsx create mode 100644 components/WebsiteBlogListPage.module.css create mode 100644 components/WebsiteBlogListPage.tsx create mode 100644 components/WebsiteImagesPage.module.css create mode 100644 components/WebsiteImagesPage.tsx create mode 100644 components/WebsiteLinkGenerator.module.css create mode 100644 components/WebsiteLinkGenerator.tsx create mode 100644 components/business/BusinessPageChrome.tsx create mode 100644 components/catalog/AddBlogForm.tsx create mode 100644 components/catalog/AddPortfolioForm.tsx create mode 100644 components/catalog/AddProductForm.tsx create mode 100644 components/catalog/BlogPanel.tsx create mode 100644 components/catalog/CatalogCardControls.tsx create mode 100644 components/catalog/CatalogCategorySelect.module.css create mode 100644 components/catalog/CatalogCategorySelect.tsx create mode 100644 components/catalog/CatalogEmptyState.module.css create mode 100644 components/catalog/CatalogEmptyState.tsx create mode 100644 components/catalog/CatalogForm.module.css create mode 100644 components/catalog/CatalogFormFields.tsx create mode 100644 components/catalog/CatalogPagination.tsx create mode 100644 components/catalog/GalleryPanel.module.css create mode 100644 components/catalog/GalleryPanel.tsx create mode 100644 components/catalog/ManageCategoriesPage.module.css create mode 100644 components/catalog/ManageCategoriesPage.tsx create mode 100644 components/catalog/PortfoliosPanel.tsx create mode 100644 components/catalog/ProductsPanel.tsx create mode 100644 components/catalog/SeoMetaFields.module.css create mode 100644 components/catalog/SeoMetaFields.tsx create mode 100644 components/catalog/utils.ts create mode 100644 data/business-nav.ts create mode 100644 data/customer-nav.ts create mode 100644 data/home.ts create mode 100644 eslint.config.mjs create mode 100644 lib/cellNumber.ts create mode 100644 lib/cropImage.ts create mode 100644 lib/faText.tsx create mode 100644 lib/host.ts create mode 100644 lib/i18n/en.ts create mode 100644 lib/managed-business.ts create mode 100644 lib/meshkee-api.ts create mode 100644 lib/session-handoff.ts create mode 100644 lib/userName.ts create mode 100644 middleware.ts create mode 100644 next.config.ts create mode 100644 package-lock.json create mode 100644 package.json create mode 100755 public/fonts/iranyekan/IRANYekanWebLight.ttf create mode 100755 public/fonts/iranyekan/IRANYekanWebRegular.ttf create mode 100644 public/images/auth/ship.png create mode 100644 public/images/icons/add.svg create mode 100644 public/images/icons/blog.svg create mode 100644 public/images/icons/calendar.svg create mode 100644 public/images/icons/category.svg create mode 100644 public/images/icons/chevron.svg create mode 100644 public/images/icons/eye.svg create mode 100644 public/images/icons/facebook.png create mode 100644 public/images/icons/gallery.svg create mode 100644 public/images/icons/gear.svg create mode 100644 public/images/icons/home-outline.svg create mode 100644 public/images/icons/home.svg create mode 100644 public/images/icons/instagram.png create mode 100644 public/images/icons/logo.png create mode 100644 public/images/icons/menu.svg create mode 100644 public/images/icons/search.svg create mode 100644 public/images/icons/telegram.png create mode 100644 public/images/icons/user.svg create mode 100644 services/auth.ts create mode 100644 services/marketplace.ts create mode 100644 services/meshkee-business-ai.ts create mode 100644 services/meshkee-businesses.ts create mode 100644 services/meshkee-catalog.ts create mode 100644 services/meshkee-categories.ts create mode 100644 services/meshkee-cities.ts create mode 100644 services/meshkee-content.ts create mode 100644 services/special-businesses.ts create mode 100644 services/website-blog.ts create mode 100644 services/website-media.ts create mode 100644 styles/ai.module.css create mode 100644 tsconfig.json create mode 100644 types/auth.ts create mode 100644 types/business.ts diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..e6e967e --- /dev/null +++ b/.env.example @@ -0,0 +1,15 @@ +NEXT_PUBLIC_WEBSITE_URL=http://localhost:3000 +# Meshkee CMS API — always remote (do not point at a local Meshkee) +NEXT_PUBLIC_MESHKEE_API_URL=https://api.meshkee.com/api/v1 +# IranBay marketplace API (local is fine) +NEXT_PUBLIC_MARKETPLACE_API_URL=http://localhost:3001/api/v1 + +# Dashboard hosts (same Next.js app; middleware switches by Host header) +NEXT_PUBLIC_ROOT_DOMAIN=localhost +# Local customer dashboard (shared login): http://customer.localhost:3002 +NEXT_PUBLIC_CUSTOMER_DASHBOARD_HOST=customer.localhost:3002 +# Local business dashboard: http://business.localhost:3002 +NEXT_PUBLIC_BUSINESS_DASHBOARD_HOST=business.localhost:3002 +# Local superadmin dashboard: http://localhost:3002 +NEXT_PUBLIC_ADMIN_DASHBOARD_HOST=localhost:3002 +NEXT_PUBLIC_MESHKEE_TENANT_DOMAIN=iranbay.com diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..40543b3 --- /dev/null +++ b/.gitignore @@ -0,0 +1,40 @@ +# dependencies +/node_modules +/.pnp +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/versions + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# env files +.env* +!.env.example + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..643577d --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,9 @@ + + +# This is NOT the Next.js you know + +This version has breaking changes — APIs, conventions, and file structure may all differ from your training data. Read the relevant guide in `node_modules/next/dist/docs/` (resolved from this file's directory; in monorepos the `next` package may not be visible from the repo root) before writing any code. Heed deprecation notices. + +This block is written and re-added by `next dev` — verify at `node_modules/next/dist/server/lib/generate-agent-files.js`. Removing it from a diff only re-creates the uncommitted change; committing it with your work keeps the tree clean. + + diff --git a/CLAUDE.md b/CLAUDE.md new file mode 100644 index 0000000..43c994c --- /dev/null +++ b/CLAUDE.md @@ -0,0 +1 @@ +@AGENTS.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..3106044 --- /dev/null +++ b/README.md @@ -0,0 +1,78 @@ +# Dashboard + +Admin, customer, and business dashboards for IranBay — one Next.js app; the `Host` header picks the experience. + +| Host | App | +|------|-----| +| `http://localhost:3002` (or `admin.`) | Superadmin | +| `http://customer.localhost:3002` (or `customer.`) | Customer account | +| `http://business.localhost:3002` (or `business.`) | Business owner | + +Public site stays on the main domain (`ariyaway.com` → `website/`). + +## Auth model + +- **One shared login** on the customer host (`/login`). +- After login, everyone lands in the **customer** dashboard. Superadmins and + business owners open admin/business from links there. +- If the user **owns a business**, customer UI shows a link to the business dashboard (session handoff across subdomains). +- Visiting `business.*/login` redirects to the customer login. +- Superadmin login stays on the admin host. + +```bash +# 1) Meshkee API (port 3010 — website already uses 3000) +cd "../MeshkeeApp Backend" +docker compose up -d +PORT=3010 npm run start:dev + +# 2) Dashboard +cd ../dashboard +cp .env.example .env.local +npm install +npm run dev +``` + +## Env + +| Variable | Local example | Prod example | +|----------|---------------|--------------| +| `NEXT_PUBLIC_ROOT_DOMAIN` | `localhost` | `ariyaway.com` | +| `NEXT_PUBLIC_CUSTOMER_DASHBOARD_HOST` | `customer.localhost:3002` | `customer.ariyaway.com` | +| `NEXT_PUBLIC_BUSINESS_DASHBOARD_HOST` | `business.localhost:3002` | `business.ariyaway.com` | +| `NEXT_PUBLIC_ADMIN_DASHBOARD_HOST` | `localhost:3002` | `admin.ariyaway.com` | +| `NEXT_PUBLIC_MESHKEE_API_URL` | Meshkee API base | same | +| `NEXT_PUBLIC_MARKETPLACE_API_URL` | `http://localhost:3001/api/v1` | marketplace API | + +Modern browsers resolve `*.localhost` without a hosts file. + +Prod: DNS `customer.*`, `business.*` (and optionally `admin.*`) → same dashboard deploy; TLS for those hosts. + +## Routes + +### Superadmin (`localhost:3002`) + +| Route | Purpose | +|-------|---------| +| `/login` | Super admin login | +| `/` | Admin home | +| `/businesses` | Marketplace listings | + +### Customer (`customer.localhost:3002`) + +| Route | Purpose | +|-------|---------| +| `/login` | Shared customer + business-owner login | +| `/` | Customer home | +| `/profile` | Account profile (read-only for now) | + +### Business (`business.localhost:3002`) + +Clean URLs (rewritten to `app/business/*`). Login redirects to customer host. + +| Route | Purpose | +|-------|---------| +| `/profile` | Meshkee business profile | +| `/products` | Product list | +| `/blog` | Blog list | +| `/portfolios` | Portfolio list | +| `/gallery` | Gallery list | diff --git a/app/auth/handoff/layout.tsx b/app/auth/handoff/layout.tsx new file mode 100644 index 0000000..14b9f29 --- /dev/null +++ b/app/auth/handoff/layout.tsx @@ -0,0 +1,64 @@ +import type { ReactNode } from "react"; + +/** + * Install session from the URL hash BEFORE React AuthProvider runs. + * Cross-subdomain localStorage is empty until this runs; without it, + * ProtectedRoute saw ?businessId= and bounced admins back to /businesses. + */ +const HANDOFF_BOOT = ` +(function () { + try { + var raw = location.hash ? location.hash.replace(/^#/, "") : ""; + if (!raw) return; + var p = new URLSearchParams(raw); + var access = p.get("access"); + var refresh = p.get("refresh"); + var businessId = p.get("businessId"); + var clearManaged = p.get("clearManaged") === "1"; + var next = p.get("next") || "/profile"; + if (!access || !refresh) return; + + localStorage.setItem("marketplace_access_token", access); + localStorage.setItem("marketplace_refresh_token", refresh); + + var root = "localhost"; + try { + // Best-effort shared cookie for *.localhost / prod root + document.cookie = + "marketplace_access_token=" + + encodeURIComponent(access) + + "; Path=/; Max-Age=1209600; SameSite=Lax; Domain=" + + root; + document.cookie = + "marketplace_refresh_token=" + + encodeURIComponent(refresh) + + "; Path=/; Max-Age=1209600; SameSite=Lax; Domain=" + + root; + } catch (e) {} + + if (businessId) { + localStorage.setItem("marketplace_managed_business_id", businessId); + sessionStorage.setItem("marketplace_managed_business_id", businessId); + } else if (clearManaged) { + localStorage.removeItem("marketplace_managed_business_id"); + sessionStorage.removeItem("marketplace_managed_business_id"); + } + + var target = next.charAt(0) === "/" ? next : "/" + next; + location.replace(target); + } catch (e) {} +})(); +`; + +export default function AuthHandoffLayout({ + children, +}: { + children: ReactNode; +}) { + return ( + <> +