How would this be updated for content collections?
import { Article } from '../domain/types';
export type Props = {
readonly currentArticle: Article;
};
const { currentArticle } = Astro.props;
const allArticles =
(await Astro.glob<Article>('../pages/posts/**/*.mdx'))
.map((article) => ({
...article.frontmatter,
url: article.url,
title: apaStyleCasing(article.frontmatter.title),
dates: { published: new Date(article.frontmatter.dates.published as unknown as string) }
}));
const sortedArticles = sortArticlesByDate(allArticles);
const currentArticleIndex = sortedArticles.findIndex((article) => article.url === currentArticle.url);
const previousArticle = sortedArticles[currentArticleIndex + 1];
const nextArticle = sortedArticles[currentArticleIndex - 1];