Initial commit: dashboard

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-10-03 23:17:36 +03:30
co-authored by Cursor
commit 3db32212ad
177 changed files with 29988 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
const MANAGED_BUSINESS_KEY = "marketplace_managed_business_id";
/**
* Superadmin-only: which Meshkee business is open on the shared business.* host.
* Regular business users ignore this and use `user.businesses` instead.
*/
export function getManagedBusinessId(): string | null {
if (typeof window === "undefined") return null;
return (
sessionStorage.getItem(MANAGED_BUSINESS_KEY) ||
localStorage.getItem(MANAGED_BUSINESS_KEY)
);
}
export function setManagedBusinessId(businessId: string | null) {
if (typeof window === "undefined") return;
if (!businessId) {
sessionStorage.removeItem(MANAGED_BUSINESS_KEY);
localStorage.removeItem(MANAGED_BUSINESS_KEY);
return;
}
const id = String(businessId);
sessionStorage.setItem(MANAGED_BUSINESS_KEY, id);
localStorage.setItem(MANAGED_BUSINESS_KEY, id);
}
export function clearManagedBusinessId() {
setManagedBusinessId(null);
}