import React from 'react';
import {YIcon} from '@/icon/index';
import {Tag} from 'antd';
import {EntryCardProps} from './entry.interface';
import {EntryCardstyled, EntryCardsCol, EntryCardsTitle, EntryCardsDes} from './styles';

export const EntryCard: React.FC<EntryCardProps> = ({title, icon, desc, onClick, isNew}) => {
  return (
    <EntryCardstyled onClick={onClick}>
      <EntryCardsCol.Left>
        <YIcon name={icon} width={56} height={56} color="#1890FF" />
      </EntryCardsCol.Left>
      <EntryCardsCol.Right>
        <EntryCardsTitle>{title}</EntryCardsTitle>
        <EntryCardsDes>{desc}</EntryCardsDes>
        {
          isNew && (
          <EntryCardsDes>
            <Tag color="#f50">new</Tag>
          </EntryCardsDes>
          )
        }

      </EntryCardsCol.Right>
    </EntryCardstyled>
  );
  }
