untitled

Pasted Nov 9, 2026, 4:10 AM1 file117 lines

Scan to open on your phone

Point a camera at the QR code - it opens this exact paste, no app needed.

https://codepastes.com/zzgs9bbb03htqggj
untitled
package com.negocio.desinfectantes.ui.productos

import androidx.compose.foundation.layout.*
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.ArrowBack
import androidx.compose.material.icons.filled.WaterDrop
import androidx.compose.material3.*
import androidx.compose.runtime.*
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.unit.dp

private val NavyAromaForm = Color(0xFF101D35)
private val CardBlueAromaForm = Color(0xFF1B2D4A)
private val AccentBlueAromaForm = Color(0xFF2585F5)
private val SoftBlueAromaForm = Color(0xFFA9BEDB)

@Composable
fun AgregarAromaScreen(
    nombreProducto: String,
    onVolver: () -> Unit,
    onGuardar: (String) -> Unit
) {
    var nombreAroma by remember { mutableStateOf("") }

    Column(
        modifier = Modifier
            .fillMaxSize()
            .padding(20.dp)
    ) {
        Row(verticalAlignment = Alignment.CenterVertically) {
            IconButton(onClick = onVolver) {
                Icon(
                    Icons.Default.ArrowBack,
                    contentDescription = "Volver",
                    tint = SoftBlueAromaForm
                )
            }

            Text(
                text = "Nuevo aroma",
                color = Color.White,
                style = MaterialTheme.typography.headlineSmall
            )
        }

        Spacer(Modifier.height(12.dp))

        Text(
            text = "PRODUCTO: $nombreProducto",
            color = SoftBlueAromaForm,
            style = MaterialTheme.typography.labelMedium
        )

        Spacer(Modifier.height(28.dp))

        Card(
            modifier = Modifier.fillMaxWidth(),
            shape = RoundedCornerShape(18.dp),
            colors = CardDefaults.cardColors(
                containerColor = CardBlueAromaForm
            )
        ) {
            Column(modifier = Modifier.padding(20.dp)) {
                Row(verticalAlignment = Alignment.CenterVertically) {
                    Icon(
                        Icons.Default.WaterDrop,
                        contentDescription = null,
                        tint = AccentBlueAromaForm
                    )

                    Spacer(Modifier.width(10.dp))

                    Text(
                        "Información del aroma",
                        color = Color.White,
                        style = MaterialTheme.typography.titleMedium
                    )
                }

                Spacer(Modifier.height(20.dp))

                OutlinedTextField(
                    value = nombreAroma,
                    onValueChange = { nombreAroma = it },
                    modifier = Modifier.fillMaxWidth(),
                    label = { Text("Nombre del aroma") },
                    placeholder = { Text("Ej. Lavanda") },
                    singleLine = true,
                    shape = RoundedCornerShape(12.dp)
                )
            }
        }

        Spacer(Modifier.height(24.dp))

        Button(
            onClick = {
                onGuardar(nombreAroma.trim())
            },
            enabled = nombreAroma.isNotBlank(),
            modifier = Modifier
                .fillMaxWidth()
                .height(54.dp),
            shape = RoundedCornerShape(14.dp),
            colors = ButtonDefaults.buttonColors(
                containerColor = AccentBlueAromaForm
            )
        ) {
            Text("Guardar aroma")
        }
    }
}

3,593 chars · codepastes.com