'use client'; import { createContext, useState } from "react"; import Alert from "@/conponent/Alert"; export const Alertconstext = createContext(); const AlertProvider = ({ children }) => { const [viuwAlert, setViuwAlert] = useState(false); const [titulo, setTitulo] = useState('Alerta'); const [mensaje, setMensaje] = useState(''); const AlertWrapper = { show: (titulo = 'Alerta', mensaje) => { setTitulo(titulo); setMensaje(mensaje); setViuwAlert(true); }, hide: () => setViuwAlert(false) } return ( {children} ) }; export default AlertProvider;