1
0
mirror of https://github.com/kremalicious/umami.git synced 2024-12-21 16:53:38 +01:00

feature(components): prop-type NavMenu

This commit is contained in:
Alexander Klein 2021-02-16 13:31:03 +01:00
parent de18b03803
commit 86c2b75e61

View File

@ -1,9 +1,10 @@
import React from 'react';
import PropTypes from 'prop-types';
import { useRouter } from 'next/router';
import classNames from 'classnames';
import styles from './NavMenu.module.css';
export default function NavMenu({ options = [], className, onSelect = () => {} }) {
function NavMenu({ options = [], className, onSelect = () => {} }) {
const router = useRouter();
return (
@ -30,3 +31,17 @@ export default function NavMenu({ options = [], className, onSelect = () => {} }
</div>
);
}
NavMenu.propTypes = {
options: PropTypes.arrayOf(
PropTypes.shape({
label: PropTypes.node,
value: PropTypes.any,
className: PropTypes.string,
render: PropTypes.func,
}),
),
className: PropTypes.string,
onSelect: PropTypes.func,
};
export default NavMenu;