// import { useState } from "react" import Link from "next/link" import { YOUTUBE_REGEX } from "../../lib/constants" import { getYoutube } from "../../utils/getYoutube" export function Latest({ posts }) { // const initialValue = 6 // const [ value, setValue ] = useState(initialValue) // const initialPosts = posts && posts.slice(0, value) // const handleButton = () => { // setValue(prev => // initialPosts.length === posts.length // ? initialValue // : prev + 3) // } return (
Our latest articles and explorations.
{youtube && YOUTUBE_REGEX.test(youtube) ? ( Video ) :
Article
} {(imageSource) &&{title}
}{description && description.length > 150 ? `${description.slice(0, imageSource ? 120 : 240)} ...` : description }