// @flow
import * as React from "react";
import cn from "classnames";
import Icon from "../Icon";
type Props = {|
+className?: string,
+label?: string,
+name: string,
+href?: string,
+right?: boolean,
+to?: string,
+RootComponent?: React.ElementType,
|};
function GalleryCardIconItem({
className,
label,
name,
href,
right,
to,
RootComponent,
}: Props): React.Node {
const positionRightClasses = "d-none d-md-inline-block ml-3";
const componentClasses = !right
? cn("icon", className)
: cn("icon", positionRightClasses, className);
const iconClasses = cn("mr-1");
const childrenForAll = (
{label}
);
const extraProps = {};
if (href) {
extraProps.href = href;
}
return RootComponent ? (
{childrenForAll}
) : (
{childrenForAll}
);
}
GalleryCardIconItem.displayName = "GalleryCard.IconItem";
/** @component */
export default GalleryCardIconItem;