feat: agregar eliminacion y Walmart Connect multipais

This commit is contained in:
Isaac_Aracena
2026-06-05 15:59:54 -04:00
parent c546f59009
commit 8c3d18814d
10 changed files with 720 additions and 404 deletions
+11 -2
View File
@@ -12,6 +12,7 @@ import { supabase } from "@/lib/supabase";
const ALLOWED_DOMAIN = "gomezleemarketing.com";
const GERARDO_EMAIL = "gmarrero@gomezleemarketing.com";
const DELETE_ALLOWED_EMAILS = [GERARDO_EMAIL, "areyes@gomezleemarketing.com"];
function isAllowedEmail(email: string | null | undefined): boolean {
if (!email) return false;
@@ -59,6 +60,7 @@ interface AuthContextValue {
loading: boolean;
error: string | null;
isGerardo: boolean;
canDeleteProjects: boolean;
loginWithGoogle: () => Promise<void>;
logout: () => Promise<void>;
}
@@ -158,10 +160,17 @@ export function AuthProvider({ children }: { children: ReactNode }) {
setError(null);
}, []);
const isGerardo = useMemo(() => !!user && user.email?.toLowerCase() === GERARDO_EMAIL, [user]);
const normalizedEmail = user?.email?.toLowerCase() || "";
const isGerardo = useMemo(() => normalizedEmail === GERARDO_EMAIL, [normalizedEmail]);
const canDeleteProjects = useMemo(
() => DELETE_ALLOWED_EMAILS.includes(normalizedEmail),
[normalizedEmail],
);
return (
<AuthContext.Provider value={{ user, loading, error, isGerardo, loginWithGoogle, logout }}>
<AuthContext.Provider
value={{ user, loading, error, isGerardo, canDeleteProjects, loginWithGoogle, logout }}
>
{children}
</AuthContext.Provider>
);