import React, { useState } from 'react'; import classnames from 'classnames'; import PropTypes from 'prop-types'; const ListMenu = ({ items = [], renderer, onClick }) => { const [selectedIndex, setSelectedIndex] = useState(null); const ListItem = ({ item, index, isSelected }) => { const flex = 'flex flex-row justify-between items-center'; const theme = 'bg-indigo-dark'; const onClickHandler = () => { setSelectedIndex(index); onClick({ item, selectedIndex: index }); if (item.onClick) { item.onClick({ ...item, index, isSelected }); } }; return (