import Link from 'next/link' import { useState, forwardRef, memo } from 'react' import date from 'date-and-time' import Loader from '../Loader' import { API_URL } from '../../utils/api' import './FunctionCard.css' const FunctionCard = memo( forwardRef((props, ref) => { const [isLoading, setIsLoading] = useState(true) const handleLoad = () => { setIsLoading(false) } const handleError = event => { event.target.src = API_URL + '/images/functions/default.png' } const isFormOrArticle = props.type === 'form' || props.type === 'article' return ( {/* FunctionCard a une hauteur pendant chargement */} {isLoading && } {props.title} {props.description} {props.categorie.name} {date.format(new Date(props.createdAt), 'DD/MM/YYYY', false)} ) }) ) export default FunctionCard
{props.description}
{props.categorie.name}
{date.format(new Date(props.createdAt), 'DD/MM/YYYY', false)}