import React from "react"; import { connect } from "react-redux"; import { dialog } from "../../redux/actions"; export const Dialog = ({ dialog, setDialog }) => { const { text, type, accept } = dialog; return (
setDialog({ ...dialog, open: !dialog.open })} >
{/* {type === "confirm" && (
exit
)} */}

{text}

{type === "confirm" && (
)} {type === "alert" && (
)}
); }; const mapStateToProps = (state) => ({ dialog: state.dialog.dialog, }); const mapDispatchToProps = { setDialog: dialog.set, }; export default connect(mapStateToProps, mapDispatchToProps)(Dialog);