Created the Card component

This commit is contained in:
Mathias Wagner 2022-09-12 00:59:48 +02:00
parent 3688f08bda
commit 70b1fb5028

View File

@ -0,0 +1,22 @@
import "./styles.sass";
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome";
import {faCaretRight} from "@fortawesome/free-solid-svg-icons";
import {Link} from "react-router-dom";
const Card = (props) => {
const content = <div className="card">
<div className="content">
<FontAwesomeIcon icon={props.icon} className="icon"/>
<h2 className="text">{props.text}</h2>
</div>
<FontAwesomeIcon icon={faCaretRight} className="icon"/>
</div>;
return (
props.to.startsWith("https") ? <a href={props.to} className="link" target="_blank">{content}</a> : <Link to={props.to} className="link">{content}</Link>
)
}
export default Card;