2024-05-10 22:24:23 +03:30
|
|
|
import "./announcementsDualButtonWithIcon.css";
|
|
|
|
|
import React from "react";
|
|
|
|
|
import CloseIcon from "@mui/icons-material/Close";
|
2024-05-11 22:48:09 +03:30
|
|
|
import PropTypes from "prop-types";
|
2024-05-10 22:24:23 +03:30
|
|
|
|
2024-05-12 21:32:39 +03:30
|
|
|
/**
|
|
|
|
|
* @component
|
|
|
|
|
* @param {Object} props
|
|
|
|
|
* @param {React.ReactNode} props.icon - Optional React node for an announcement icon
|
|
|
|
|
* @param {string} props.subject - The announcement subject text
|
|
|
|
|
* @param {string} props.body - The announcement body text content
|
|
|
|
|
* @param {string} props.esc - The text for the escape button (usually "Close")
|
|
|
|
|
* @param {string} props.primary - The text for the primary button
|
|
|
|
|
* @returns {JSX.Element} - Renders the announcement dual button with icon component
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
const AnnouncementsDualButtonWithIcon = ({
|
2024-05-10 22:24:23 +03:30
|
|
|
icon,
|
|
|
|
|
subject,
|
|
|
|
|
body,
|
|
|
|
|
esc,
|
|
|
|
|
primary,
|
2024-05-12 21:32:39 +03:30
|
|
|
}) => {
|
2024-05-10 22:24:23 +03:30
|
|
|
return (
|
|
|
|
|
<div className="announcement-tile">
|
|
|
|
|
{icon && <div className="announcement-icon">{icon}</div>}
|
|
|
|
|
<div className="announcement-content">
|
|
|
|
|
{subject && (
|
|
|
|
|
<div className="announcement-content-subject">{subject}</div>
|
|
|
|
|
)}
|
|
|
|
|
{body && <div className="announcement-content-body">{body}</div>}
|
|
|
|
|
{(esc || primary) && (
|
|
|
|
|
<div className="announcement-content-controllers">
|
|
|
|
|
{esc && <div className="controllers-button-esc">{esc}</div>}
|
|
|
|
|
{primary && (
|
|
|
|
|
<div className="controllers-button-primary">{primary}</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
|
|
|
|
<div className="announcement-close">
|
|
|
|
|
<CloseIcon style={{ fill: "#98A2B3" }} />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2024-05-12 21:32:39 +03:30
|
|
|
};
|
2024-05-10 22:24:23 +03:30
|
|
|
|
2024-05-11 22:48:09 +03:30
|
|
|
AnnouncementsDualButtonWithIcon.propTypes = {
|
|
|
|
|
icon: PropTypes.object,
|
|
|
|
|
subject: PropTypes.string,
|
|
|
|
|
body: PropTypes.string,
|
|
|
|
|
esc: PropTypes.string,
|
|
|
|
|
primary: PropTypes.string,
|
|
|
|
|
};
|
|
|
|
|
|
2024-05-10 22:24:23 +03:30
|
|
|
export default AnnouncementsDualButtonWithIcon;
|