60 lines
2.0 KiB
JavaScript
60 lines
2.0 KiB
JavaScript
/*
|
||
Парус 8 - Панели мониторинга - РО - Редактор настройки регламентированного отчёта
|
||
Компонент панели: Сообщение с действиями
|
||
*/
|
||
|
||
//---------------------
|
||
//Подключение библиотек
|
||
//---------------------
|
||
|
||
import React from "react"; //Классы React
|
||
import PropTypes from "prop-types"; //Контроль свойств компонента
|
||
import { Icon, Stack, Typography } from "@mui/material"; //Интерфейсные элементы
|
||
|
||
//---------
|
||
//Константы
|
||
//---------
|
||
|
||
//Стили
|
||
const STYLES = {
|
||
CONTAINER: { height: "100%", width: "100%" }
|
||
};
|
||
|
||
//-----------
|
||
//Тело модуля
|
||
//-----------
|
||
|
||
//Сообщение с действиями
|
||
const ActionMessage = ({ icon, title, desc, children }) => {
|
||
return (
|
||
<Stack direction={"column"} justifyContent={"center"} sx={STYLES.CONTAINER}>
|
||
<Stack direction={"row"} justifyContent={"center"} alignItems={"center"}>
|
||
<Icon color={"disabled"}>{icon}</Icon>
|
||
<Typography align={"center"} color={"text.secondary"} variant={"button"}>
|
||
{title}
|
||
</Typography>
|
||
</Stack>
|
||
<Typography align={"center"} variant={"caption"}>
|
||
{desc}
|
||
</Typography>
|
||
<Stack direction={"row"} justifyContent={"center"} alignItems={"center"}>
|
||
{children}
|
||
</Stack>
|
||
</Stack>
|
||
);
|
||
};
|
||
|
||
//Контроль свойств - Сообщение с действиями
|
||
ActionMessage.propTypes = {
|
||
icon: PropTypes.string.isRequired,
|
||
title: PropTypes.string.isRequired,
|
||
desc: PropTypes.oneOfType([PropTypes.string, PropTypes.object]).isRequired,
|
||
children: PropTypes.oneOfType([PropTypes.node, PropTypes.arrayOf(PropTypes.node)])
|
||
};
|
||
|
||
//----------------
|
||
//Интерфейс модуля
|
||
//----------------
|
||
|
||
export { ActionMessage };
|