"use strict";

const React = require("react");
const classnames = require("classnames");

function CloseButton({onClick}) {
	return (
		<div className="closeButton" onClick={onClick}>✖</div>
	);
}

module.exports = function Notification({store, id, type, title, message, controls}) {
	return (
		<div className={classnames("notification", `type-${type}`)}>
			<CloseButton onClick={() => store.markRead(id)} />
			<div className="header">
				{title}
			</div>
			<div className="contents">
				{message}
			</div>
			<div className="controls">
				{controls}
			</div>
		</div>
	);
};
