Files
frontend-component-header/src/studio-header/NavDropdownMenu.jsx
Mashal Malik 19292cd5b6 refactor: replace @edx/paragon with @openedx/paragon (#446)
* refactor: replace @edx/paragon with @openedx/paragon

* fix: replaced frontend-build to @openedx to fix jest issues

* refactor: removed old unused package

---------

Co-authored-by: Abdullah Waheed <abdullah.waheed@arbisoft.com>
2024-01-01 13:08:15 +05:00

41 lines
794 B
JavaScript

import React from 'react';
import PropTypes from 'prop-types';
import {
Dropdown,
DropdownButton,
} from '@openedx/paragon';
const NavDropdownMenu = ({
id,
buttonTitle,
items,
}) => (
<DropdownButton
id={id}
title={buttonTitle}
variant="outline-primary"
className="mr-2"
>
{items.map(item => (
<Dropdown.Item
key={`${item.title}-dropdown-item`}
href={item.href}
className="small"
>
{item.title}
</Dropdown.Item>
))}
</DropdownButton>
);
NavDropdownMenu.propTypes = {
id: PropTypes.string.isRequired,
buttonTitle: PropTypes.string.isRequired,
items: PropTypes.arrayOf(PropTypes.shape({
href: PropTypes.string,
title: PropTypes.string,
})).isRequired,
};
export default NavDropdownMenu;