package com.example.wabi.view.screens.signUp

import androidx.lifecycle.ViewModel
import androidx.navigation.NavHostController
import com.example.wabi.domain.navigation.NavigationFun
import com.example.wabi.domain.navigation.Routes
import com.example.wabi.domain.network.SupabaseServiceImpl
import dagger.hilt.android.lifecycle.HiltViewModel
import javax.inject.Inject

@HiltViewModel
class SignUpViewModel @Inject constructor(
    private val sup: SupabaseServiceImpl, private val nav: NavigationFun
) : ViewModel() {
    fun goToSignIn(navController: NavHostController) {
        nav.NextScreen(navController, whereFrom = Routes.SIGNUP, where = Routes.SIGNIN)
    }

    fun validateEmail(email: String): Boolean {
        return android.util.Patterns.EMAIL_ADDRESS.matcher(email).matches()
    }
}