diff --git a/components/MessageBox.css b/components/MessageBox.css new file mode 100644 index 000000000000..cfbec6759482 --- /dev/null +++ b/components/MessageBox.css @@ -0,0 +1,27 @@ +/* src/css/messageBox.css */ + +.message-box { + position: fixed; + bottom: 20px; + right: 10px; + background-color: hwb(0 80% 2%); + z-index: 1000; /* Set a high z-index value */ + border: 1px solid #ccc; + border-radius: 10px; + padding: 20px; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); + max-width: 270px; /* Adjust width as needed */ + } + + .close-button { + position: absolute; + top: 5px; + right: 5px; + background: none; + border: none; + cursor: pointer; + } + + .messageContent { + margin-top: 10px; + } \ No newline at end of file diff --git a/components/MessageBox.jsx b/components/MessageBox.jsx new file mode 100644 index 000000000000..820b8cb4369d --- /dev/null +++ b/components/MessageBox.jsx @@ -0,0 +1,32 @@ +import React, { useState } from 'react'; + +const MessageBox = ({ message }) => { + const [isOpen, setIsOpen] = useState(true); + + const handleClose = () => { + setIsOpen(false); + }; + + // Function to convert markdown links to HTML links + const renderMarkdownLinks = (text) => { + return text.replace(/\[(.*?)\]\((.*?)\)/g, '$1'); + }; + + return ( + <> + {isOpen && ( +