22 lines
835 B
JavaScript
22 lines
835 B
JavaScript
|
|
"use client";
|
|||
|
|
import { useState } from "react";
|
|||
|
|
import NuevaActividad from "./NuevaActividad";
|
|||
|
|
|
|||
|
|
// Botón «Agregar actividad» de la ficha de una cuenta: abre la ventana ya ligada a esa cuenta. Si la cuenta
|
|||
|
|
// tiene oportunidades abiertas, la ventana deja elegir si la actividad va a la cuenta o a una de ellas.
|
|||
|
|
export default function NuevaActividadBoton({ hoy, referente, oportunidades = [] }) {
|
|||
|
|
const [abierto, setAbierto] = useState(false);
|
|||
|
|
return (
|
|||
|
|
<>
|
|||
|
|
<button type="button" className="gst-go" style={{ padding: "8px 16px" }} onClick={() => setAbierto(true)}>+ Agregar actividad</button>
|
|||
|
|
{abierto && (
|
|||
|
|
<NuevaActividad
|
|||
|
|
hoy={hoy}
|
|||
|
|
preset={{ referente, dia: hoy, hora: "09:00", opciones: oportunidades }}
|
|||
|
|
onClose={() => setAbierto(false)}
|
|||
|
|
/>
|
|||
|
|
)}
|
|||
|
|
</>
|
|||
|
|
);
|
|||
|
|
}
|