import { browser } from "$app/environment";

/**
 * Store global para controlar o modal de login
 */
class LoginModalStore {
  showModal = $state(false);
  redirectAfterLogin = $state<string | null>(null);

  open(redirectTo?: string) {
    this.showModal = true;
    this.redirectAfterLogin = redirectTo || null;
  }

  close() {
    this.showModal = false;
    this.redirectAfterLogin = null;
  }
}

export const loginModalStore = new LoginModalStore();

