package com.example.wabi.view.screens.signIn

import androidx.compose.foundation.layout.Row
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.hilt.navigation.compose.hiltViewModel
import androidx.navigation.NavHostController
import com.example.wabi.view.common_elements.textfields.CodeTextField
import com.example.wabi.view.common_elements.textfields.MainTextField
import com.example.wabi.view.common_elements.textfields.PasswordTextField

@Composable
fun SignIn(navController: NavHostController, vm: SignInViewModel = hiltViewModel()) {
    val data = vm.data

    Row {
        Text("Это вход")
    }

    CodeTextField(
        value = data.email,
        input = { vm.UpdateData(data.copy(email = it)) },
    )
    MainTextField(
        value = data.email,
        input = { vm.UpdateData(data.copy(email = it)) },
        placeholder = "Почта",
        lable = "Введите почту:",
        trailingText = ""
    )
    PasswordTextField(
        value = data.password,
        input = { vm.UpdateData(data.copy(password = it)) },
        placeholder = "Пароль",
        lable = "Введите пароль:"
    )
}