import React from 'react'; import { CardProps } from './types'; import { iconTypes } from '../Icon/collection'; import colors from '../../styles/colors'; import { Icon } from '../Icon'; import { Tooltip } from '../Tooltip'; import styles from './Card.styles'; import { Typography } from '../Typography'; import color from '../../styles/colors'; const { AbsoluteIconStyled, DivStyled, FooterStyled, HeaderStyled } = styles; const Card: React.FC = ({ children, cursorType = 'pointer', description, id, isDisabled = false, isSelected, onClick, setIsSelected, title, tooltipMove, tooltipMoveBody, tooltipText, ...props }: CardProps) => { return ( { if (isDisabled) return; onClick && onClick(); if (!setIsSelected) return; setIsSelected(!isSelected); }} role="button" isSelected={isSelected} isDisabled={isDisabled} cursorType={cursorType} {...props} > {isSelected && ( )} {!isDisabled && tooltipText && ( , ]} content={tooltipText} move={tooltipMove} moveBody={tooltipMoveBody} /> )}
{children}
{(title || description) && ( {title && ( {title} )} {description && ( {description} )} )}
); }; export default Card;