P8-Panels/app/panels/rrp_conf_editor/section_tab_panel.js

45 lines
1.4 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*
Парус 8 - Панели мониторинга - РО - Редактор настройки регламентированного отчёта
Панель мониторинга: Компонент вкладки раздела
*/
//---------------------
//Подключение библиотек
//---------------------
import React from "react"; //Классы React
import PropTypes from "prop-types"; //Контроль свойств компонента
import { Box, Typography } from "@mui/material"; //Интерфейсные компоненты
//---------------
//Тело компонента
//---------------
const SectionTabPanel = props => {
const { children, value, index, ...other } = props;
//Генерация содержимого
return (
<div role="tabpanel" hidden={value !== index} id={`tabpanel-${index}`} aria-labelledby={`tab-${index}`} {...other}>
{value === index && (
<Box p={3}>
<Typography component="span">{children}</Typography>
</Box>
)}
</div>
);
};
//Контроль свойств - Вкладка раздела
SectionTabPanel.propTypes = {
children: PropTypes.node,
index: PropTypes.number.isRequired,
value: PropTypes.number.isRequired
};
//--------------------
//Интерфейс компонента
//--------------------
export { SectionTabPanel };