File size: 644 Bytes
f5071ca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import React from "react";

const CardComponent = (props) => {
  const { tag, articles } = props;
  return (
    <div className="card">
      <header>
        <h3>{tag}</h3>
        {tag === "Listings" && (
          <a href="/#">
            <small>see all</small>
          </a>
        )}
      </header>
      <ul>
        {articles.map((a) => {
          return (
            <li key={a.id}>
              <a href="/#">{a.mainTitle}</a> <br />
              <small>{a.subText}</small>
              {a.newarticle && <span>new</span>}
            </li>
          );
        })}
      </ul>
    </div>
  );
};

export default CardComponent;