---
import { getCollection, getEntry } from "astro:content";
import type { CollectionEntry } from "astro:content";
interface Props {
collectionName: CollectionEntry<"diaryMainPages">["slug"];
}
const { collectionName } = Astro.props;
const collectionTitle = (await getEntry("diaryMainPages", collectionName)).data
.title;
const collection = (await getCollection(collectionName)).sort(
(a, b) => a.data.sorting - b.data.sorting,
);
const collectionBasePath = `/blog/${collectionName}`;
const pageSelectedClass = (slug?: string) =>
`${collectionBasePath}${slug ? "/" + slug : ""}` === Astro.url.pathname
? "pageSelected"
: "";
---