import { Box, Flex, Stack, Spacer, Text } from "@chakra-ui/react"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { forwardRef } from "react"; interface Item { label: string; value: string | string[]; } interface Props { item: Item; 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]); }} > {Array.isArray(item.value) ? ( {item.label} {item.value[scrollIndex]} ) : ( item.label )} ); }); export default ListItem;