import React, { forwardRef, useContext } from "react"; import { BodyLong } from "../typography"; import { cl } from "../utils/helpers"; import { ListContext } from "./List.context"; import type { ListItemProps } from "./List.types"; /** * @see 🏷️ {@link ListItemProps} */ export const ListItem = forwardRef( ({ className, children, title, icon, ...rest }, ref) => { const { listType, size } = useContext(ListContext); if (listType === "ol" && icon) { console.warn( ": Icon prop is not supported for ordered lists. Please remove the icon prop.", ); } return (
  • {listType === "ul" && (
    {icon ? ( icon ) : ( )}
    )}
    {title && ( {title} )} {children}
  • ); }, ); ListItem.displayName = "List.Item"; export default ListItem;