
import { H2 } from "../UI/Texts"

const posts = [
  {
    id: 'depin_summit_recap',
    title: 'From Vision to Reality: DePIN Comes Alive in East Africa',
    href: '#',
    description:
      'A powerful week of community, collaboration, and real-world impact as decentralized infrastructure takes root in East Africa.',
    imageUrl: '/images/news/depin_summit_recap.jpg',
    date: 'July 11, 2025',
    datetime: '2025-07-11',
    author: {
      name: 'Sam Taggart',
      imageUrl: '/images/home/sam_taggart.jpg',
    },
  },
  {
    id: 'africa_regen_summit_ii',
    title:
      'Reflecting on Africa Regenerative Futures Summits : Shaping a better digital future in Africa',
    href: '#',
    description:
      'In 2023, we had the pleasure of hosting two summits in Zanzibar – read about the key outcomes and how they are shaping a better digital future in Africa.',
    imageUrl: '/images/news/africa_regen_summit_ii.jpg',
    date: 'November 21, 2023',
    datetime: '2023-11-21',
    author: {
      name: 'Sam Taggart',
      imageUrl:
        'https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=facearea&facepad=2&w=256&h=256&q=80',
    },
  },
  {
    id: 'transformative_impact_summit',
    title: 'Creating Transformative Impact',
    href: '#',
    description:
      'Learn about the Transformative Impact Summit, held June 7–9 in Zanzibar, and how ThreeFold participated.',
    imageUrl: '/images/news/transformative_impact_summit.jpeg',
    date: 'June 14, 2024',
    datetime: '2024-06-14',
    author: {
      name: 'Sam Taggart',
      imageUrl: '/images/home/sam_taggart.jpg',
    },
  },
]

export function News() {
  return (
    <div className="bg-transparent py-16">
      <div className="mx-auto max-w-7xl px-6 lg:px-8">
        <div className="max-w-2xl text-left">
          <H2 className="text-void">
            News & Updates
          </H2>
        </div>
        <div className="mx-auto grid max-w-2xl auto-rows-fr grid-cols-1 gap-8 mt-12 lg:mx-0 lg:max-w-none lg:grid-cols-3">
          {posts.map((post) => (
            <article
              key={post.id}
              className="group relative isolate flex flex-col justify-end overflow-hidden rounded-lg bg-gray-900 px-8 pb-8 aspect-[4/3] transition-transform duration-200 hover:-translate-y-1 hover:shadow-xl"
            >
              <img alt="" src={post.imageUrl} className="absolute inset-0 -z-10 size-full object-cover" />
              <div className="absolute inset-0 -z-10 bg-linear-to-t from-gray-900 via-gray-900/40" />
              <div className="absolute inset-0 -z-10 rounded-2xl inset-ring inset-ring-gray-900/10 group-hover:inset-ring-gray-100/20" />

              <div className="flex flex-wrap items-center gap-y-1 overflow-hidden text-sm/6 text-gray-300">
                <time dateTime={post.datetime} className="mr-8">
                  {post.date}
                </time>
                <div className="-ml-4 flex items-center gap-x-4">
                  <svg viewBox="0 0 2 2" className="-ml-0.5 size-0.5 flex-none fill-white/50">
                    <circle r={1} cx={1} cy={1} />
                  </svg>
                  <div className="flex gap-x-2.5">
                    <img alt="" src={post.author.imageUrl} className="size-6 flex-none rounded-full bg-white/10" />
                    {post.author.name}
                  </div>
                </div>
              </div>
              <h3 className="mt-3 text-lg/6 font-semibold text-white">
                <a href={post.href}>
                  <span className="absolute inset-0" />
                  {post.title}
                </a>
              </h3>
            </article>
          ))}
        </div>
      </div>
    </div>
  )
}
