import React from 'react';
import Thumb from 'components/Thumb';
import defaultThumb from 'images/favorite_default.jpg';
import styles from './FavoriteItem.less';
import {getAssetsUrl} from 'utils/utils'

export default function TenantConstantItem({ name, moduleName, version, thumb, addComponent }) {
  return (
    <div className={styles.container} onClick={() => addComponent({ name, moduleName, version, isTenant: true })}>
      <Thumb className={styles.img} src={thumb ? getAssetsUrl(thumb) : defaultThumb} />
      <p className={styles.name}>{name}</p>
    </div>
  );
}
