UNPKG

@coinmeca/ui

Version:

This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).

22 lines 1.05 kB
"use client"; import Modal from "../../../containers/modals/Modal"; import { Controls } from "../../../components"; export default function Alert(props) { const handleLeftClick = (e) => { if (typeof props?.buttonLeft?.onClick === "function") props?.buttonLeft?.onClick(e); if (typeof props?.onClose === "function") props?.onClose(e); }; const handleRightClick = (e) => { if (typeof props?.buttonRight?.onClick === "function") props?.buttonRight?.onClick(e); if (typeof props?.onClose === "function") props?.onClose(e); }; return (<Modal title={props?.title} message={props?.message} buttonArea={<> <Controls.Button onClick={(e) => handleLeftClick(e)}>{props?.buttonLeft?.name || "Cancel"}</Controls.Button> <Controls.Button onClick={(e) => handleRightClick(e)}>{props?.buttonRight?.name || "OK"}</Controls.Button> </>} onClose={props?.onClose} close/>); } //# sourceMappingURL=Alert.jsx.map