import React from 'react';
import { ICardClickable } from './CardTypes';
import { 
  CardClickable,
  CardClickableInfo,
  CardClickableCategory,
  CardClickableImage,
  CardClickableDescription,
  CardClickableTitle,
  CardClickablePoints,
} from './styles';
import { AtomBody } from 'native/atoms/Typography/Body';
import { AtomImage } from 'native/atoms/Image';

export const OrganismCardClickable = ({
  type,
  description,
  image,
  title,
  points,
  handleClick,
  category,
}: ICardClickable) => {
  return (
    <CardClickable onPress={handleClick} type={type}>
      {
        category && type === 'vertical' && (
          <CardClickableCategory>
            <AtomBody text={category} size='small' color={'neutral500'} weight='regular' />
          </CardClickableCategory>
        )
      }
      <CardClickableImage type={type}>
        <AtomImage
          src={image}
          alt='card clickable image'
          imgWidth='100%'
          imgHeight='160px'
        />
      </CardClickableImage>
      <CardClickableInfo type={type}>
        <CardClickableDescription>
          <AtomBody
            text={description}
            size='small'
            color={'neutral500'}
            weight='regular'
            align={type === 'horizontal' ? 'left' : 'center'}
          />
        </CardClickableDescription>
        <CardClickableTitle type={type}>
          <AtomBody
            text={title}
            size='medium'
            weight='bold'
            styles={{textAlign: 'center'}}
            align={type === 'horizontal' ? 'left' : 'center'}
          />
        </CardClickableTitle>
        <CardClickablePoints>
          <AtomBody
            text={points}
            size='medium'
            weight='bold'
            color={'primary'}
            align={type === 'horizontal' ? 'left' : 'center'}
          />
        </CardClickablePoints>
      </CardClickableInfo>
    </CardClickable>
  )
}
