app/src/main/java/com/studhub/app/presentation/ui/common/input/EmailTextField.kt
package com.studhub.app.presentation.ui.common.input
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material3.*
import androidx.compose.runtime.Composable
import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.TextFieldValue
@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun EmailTextField(
label: String = "Email",
email: TextFieldValue,
onEmailValueChange: (newValue: TextFieldValue) -> Unit
) {
OutlinedTextField(
value = email,
onValueChange = { newValue ->
onEmailValueChange(newValue)
},
label = {
Text(
text = label
)
},
singleLine = true,
keyboardOptions = KeyboardOptions(
keyboardType = KeyboardType.Email
),
colors = OutlinedTextFieldDefaults.colors(
unfocusedTextColor = MaterialTheme.colorScheme.onBackground,
focusedTextColor = MaterialTheme.colorScheme.onBackground
)
)
}