import React, { useState } from "react"; import PropTypes from "prop-types"; import LinkWithDropdown from "../link-with-dropdown/index.js"; import AccessRightItem from "./sub-components/access-right-item.js"; const AccessRightSelect = ({ accessRightsList, quotaList, ...props }) => { const [currentItem, setCurrentItem] = useState(accessRightsList[6]); const formatToAccessRightItem = (data) => { return data.map((it) => { const itQuota = quotaList.find((elem) => elem.accessRightKey == it.key); return it.isSeparator ? { ...it } : { key: it.key, children: ( ), onClick: () => setCurrentItem(it), }; }); }; return (
{currentItem?.title}
); }; AccessRightSelect.propTypes = { /** List of rights */ accessRightsList: PropTypes.arrayOf(PropTypes.object), /** List of quotas */ quotaList: PropTypes.arrayOf(PropTypes.object), }; export default AccessRightSelect;