informe-comercial-alfa/app/components/actividades/NuevaActividadBoton.js

21 lines
835 B
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

"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)}
/>
)}
</>
);
}