// @flow import * as React from "react"; import cn from "classnames"; import { Icon } from "../../components"; type Props = {| +children?: React.Node, +className?: string, +RootComponent?: React.ElementType, +active?: boolean, +action?: boolean, +icon?: string, +to?: string, |}; function ListGroupItem({ className, children, RootComponent, active, action, icon, to, }: Props): React.Node { const classes = cn( "list-group-item", { "list-group-item-action": action, }, { active: active, }, className ); // const Component = RootComponent || "a"; return RootComponent ? ( {icon && ( {" "} )} {children} ) : ( {icon && ( {" "} )} {children} ); } ListGroupItem.displayName = "List.GroupItem"; /** @component */ export default ListGroupItem;