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 React from 'react';
import PropTypes from 'prop-types';
import { useRouter } from 'next/router'; import { useRouter } from 'next/router';
import classNames from 'classnames'; import classNames from 'classnames';
import styles from './NavMenu.module.css'; import styles from './NavMenu.module.css';
export default function NavMenu({ options = [], className, onSelect = () => {} }) { function NavMenu({ options = [], className, onSelect = () => {} }) {
const router = useRouter(); const router = useRouter();
return ( return (
@ -30,3 +31,17 @@ export default function NavMenu({ options = [], className, onSelect = () => {} }
</div> </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;