import React, { FunctionComponent } from 'react';
import { CardTagsProps } from '../types.d';

export const CardTags: FunctionComponent<CardTagsProps> = ({ data }) => {
  if (!data) return null;
  return (
    <div className="card__parameters">
      {data.map((tag) => (
        <div className={`card__parameter card__parameter_time ${tag.color}`}>
          {tag.icon ? tag.icon : <></>}
          {tag.text}
        </div>
      ))}
    </div>
  );
};
