diff --git a/src/components/Notification.jsx b/src/components/Notification.jsx index 93141c1..542bd45 100644 --- a/src/components/Notification.jsx +++ b/src/components/Notification.jsx @@ -3,49 +3,46 @@ import { Copy } from "lucide-react"; import { motion } from "motion/react"; import PropTypes from "prop-types"; -function Notification({ notification }) { -return - {notification.message.split(":").map((msg, index) => { + type === "error" + ? "bg-error-surface text-white border-error" + : type === "success" + ? "bg-success text-white border-green-700" + : type === "warning" + ? "bg-warning-surface text-white border-warning" + : "" + )} + > + {message.split(":").map((msg, index) => { return index === 1 ? ( - - {msg} - + + {msg} + ) : ( - {msg} + {msg} ); - })} - {notification.message.split(":")[1] && ( + })} + {message.split(":")[1] && ( - )} -; + )} + + ); } Notification.propTypes = { - notification: PropTypes.shape({ - visible: PropTypes.bool, - message: PropTypes.string, - type: PropTypes.string, - }), + message: PropTypes.string.isRequired, + type: PropTypes.string.isRequired, }; export default Notification;