import React from 'react'; import { Nav, NavExpandable, NavItem, NavList } from '@patternfly/react-core'; export const NavExpandableExample: React.FunctionComponent = () => { const [activeGroup, setActiveGroup] = React.useState('nav-expandable-group-1'); const [activeItem, setActiveItem] = React.useState('nav-expandable-group-1_item-1'); const onSelect = ( _event: React.FormEvent, result: { itemId: number | string; groupId: number | string } ) => { setActiveGroup(result.groupId as string); setActiveItem(result.itemId as string); }; const onToggle = ( _event: React.MouseEvent, result: { groupId: number | string; isExpanded: boolean } ) => { // eslint-disable-next-line no-console console.log(`Group ${result.groupId} expanded? ${result.isExpanded}`); }; const onItemClick = ( _event: React.FormEvent, itemId: number | string, _groupId: number | string ) => { // eslint-disable-next-line no-console console.log(`Custom click handler on ${itemId}`); }; return (
); };