deploy-branch / deploy (push) Successful in 2m18s
deploy-branch / teardown (push) Skipped
tests / Unitarias + componente + build (pull_request) Successful in 2m23s
tests / Integración (Nominatim real, opt-in) (pull_request) Skipped
tests / Unitarias + componente + build (push) Successful in 2m30s
tests / Integración (Nominatim real, opt-in) (push) Skipped
- Nuevo PasoDatosLocal con nombre, provincia y dirección (ahora editable) en la misma pantalla, con aviso cuando vienen de la inferencia - El wizard pasa de 6 a 5 pasos: Ubicación → Datos del local → Categoría → Tipo específico → Resumen - Eliminados PasoNombre y PasoProvincia (absorbidos) - Spec principal actualizada al nuevo orden de pantallas
74 lines
2.9 KiB
React
74 lines
2.9 KiB
React
import { inputStyle } from "../styles/shared.js";
|
|
import { PROVINCIAS } from "../constants/provincias.js";
|
|
|
|
const etiqueta = { fontSize: 12, color: "var(--color-text-secondary)", display: "block", marginBottom: 4 };
|
|
|
|
// Paso 2 de la pasarela: los datos inferidos desde la ubicación (nombre,
|
|
// provincia y dirección), pre-rellenados y editables en una misma pantalla.
|
|
// Si la inferencia falló o no casó con el listado, llegan vacíos y se
|
|
// rellenan a mano, sin bloquear la pasarela.
|
|
export default function PasoDatosLocal({ form, setForm }) {
|
|
const algunoInferido = !!(form.nombre || form.provincia || form.direccion);
|
|
return (
|
|
<div style={{ display: "flex", flexDirection: "column", gap: 12 }}>
|
|
{algunoInferido && (
|
|
<div role="status" style={{
|
|
display: "flex", alignItems: "flex-start", gap: 6,
|
|
background: "#EAFAF1", color: "#1E8449",
|
|
padding: "6px 10px", borderRadius: "var(--border-radius-md)", fontSize: 12,
|
|
}}>
|
|
<i className="ti ti-sparkles" aria-hidden="true" style={{ fontSize: 14, flexShrink: 0, marginTop: 1 }}></i>
|
|
<span style={{ lineHeight: 1.4 }}>
|
|
Rellenados automáticamente desde la ubicación: compruébalos y corrige lo que haga falta.
|
|
</span>
|
|
</div>
|
|
)}
|
|
|
|
<div>
|
|
<label htmlFor="paso-nombre" style={etiqueta}>
|
|
Nombre del local <span style={{ color: "#8B0000" }}>*</span>
|
|
</label>
|
|
<input
|
|
id="paso-nombre"
|
|
style={inputStyle}
|
|
autoComplete="off"
|
|
placeholder="Bar El Olivo, Clínica San José..."
|
|
value={form.nombre}
|
|
onChange={(e) => setForm((f) => ({ ...f, nombre: e.target.value }))}
|
|
/>
|
|
</div>
|
|
|
|
<div>
|
|
<label htmlFor="paso-provincia" style={etiqueta}>
|
|
Provincia <span style={{ color: "#8B0000" }}>*</span>
|
|
</label>
|
|
<select
|
|
id="paso-provincia"
|
|
style={inputStyle}
|
|
value={form.provincia}
|
|
onChange={(e) => setForm((f) => ({ ...f, provincia: e.target.value }))}
|
|
>
|
|
<option value="">Selecciona provincia...</option>
|
|
{PROVINCIAS.map((p) => <option key={p} value={p}>{p}</option>)}
|
|
</select>
|
|
</div>
|
|
|
|
<div>
|
|
<label htmlFor="paso-direccion" style={etiqueta}>Dirección</label>
|
|
<input
|
|
id="paso-direccion"
|
|
style={inputStyle}
|
|
autoComplete="off"
|
|
placeholder="Calle, número, ciudad"
|
|
value={form.direccion}
|
|
onChange={(e) => setForm((f) => ({ ...f, direccion: e.target.value }))}
|
|
aria-describedby="paso-direccion-ayuda"
|
|
/>
|
|
<p id="paso-direccion-ayuda" style={{ fontSize: 11, color: "var(--color-text-tertiary)", margin: "4px 0 0" }}>
|
|
Opcional: se rellena automáticamente desde la ubicación; corrígela si hace falta.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|