// @flow import * as React from "react"; import cn from "classnames"; import { List, Icon, Button } from "../"; type itemObject = {| name: string, label?: string, to?: string, tooltip?: string, color?: string, |}; type Props = {| +children?: React.Node, +className?: string, +asButtons?: boolean, +prefix?: string, +itemsObjects?: Array, +items?: Array, |}; function listItemFromObjectFactory( asButtons: boolean = false, iconPrefix: string ) { return (item: itemObject) => { const itemContent = asButtons ? ( ) : ( ); return {itemContent}; }; } function SocialNetworksList(props: Props): React.Node { const { children, className, asButtons, prefix = "fe", items, itemsObjects, } = props; const classes = cn("social-links", className); const getObjectListItem = listItemFromObjectFactory(asButtons, prefix); const contents = (itemsObjects && itemsObjects.map(getObjectListItem)) || (items && items.map(item => {item})) || children; return ( {contents} ); } SocialNetworksList.displayName = "SocialNetworksList"; export default SocialNetworksList;