import { faArrowUpRightFromSquare } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import PropTypes from "prop-types"; import { useState, useEffect } from "react"; export default function Card({ title, link }) { const [image, setImage] = useState(""); useEffect(() => { const getImage = async () => { const response = await fetch("https://api.miarma.net/v1/screenshot?url=" + link); const blob = await response.blob(); const imageURL = URL.createObjectURL(blob); setImage(imageURL); } getImage(); }, [link]); return (
{title}
Ir
) } Card.propTypes = { title: PropTypes.string.isRequired, description: PropTypes.string.isRequired, link: PropTypes.string.isRequired, onHoverStart: PropTypes.func, onHoverEnd: PropTypes.func, }