import { Box, Flex, Stack, Spacer, Text, IconProps } from "@chakra-ui/react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { forwardRef } from "react"; import type { MenuItem } from "./index"; interface Props { item: MenuItem; index: number; scrollIndex: number; } const ListItem = forwardRef, Props>(({ item, index, scrollIndex }, ref) => { return ( { if (ref) // @ts-ignore i cba return (ref.current = [...ref.current, element]); }} > {item.icon && ( )} {Array.isArray(item.values) ? ( {item.label} {item.values[scrollIndex]} {scrollIndex + 1}/{item.values.length} ) : ( {item.label} )} ); }); export default ListItem;