'use client';

import { IPostThumbResponseData } from '@/app/api/blog/data';
import routeFactory from '@/assets/constants/routeFactory';
import { TLocales } from '@/models/layout';
import PostThumb from './PostThumb';
import { useTranslations } from 'next-intl';

export default function PostsGridView({
  posts,
  locale,
}: {
  posts: IPostThumbResponseData[];
  locale: TLocales;
}) {
  const t = useTranslations();
  const routes = routeFactory(t, locale);

  return (
    <>
      {posts.map((post) => (
        <PostThumb key={post.id} post={post} locale={locale} />
      ))}
    </>
  );
}
