fix: use CollectionEntry type where possible

This commit is contained in:
Troy 2025-03-13 21:45:16 +00:00
parent aa26e7cd55
commit 82b68b9f11
Signed by: troy
GPG key ID: DFC06C02ED3B4711
8 changed files with 107 additions and 104 deletions

View file

@ -80,7 +80,7 @@ const listFormatter = new Intl.ListFormat("en-GB", {
article.data.tags ? (
<div class="flex flex-wrap items-center gap-2">
<Icon name="mdi:tag" />
{article.data.tags.map((tag: any) => (
{article.data.tags.map((tag: string) => (
<a
href={`/tags/${createSlug(tag)}`}
class="underline hover:no-underline"

View file

@ -1,8 +1,9 @@
---
import FormattedDate from "@components/FormattedDate.astro";
import type { CollectionEntry } from "astro:content";
type Props = {
collection: any;
collection: CollectionEntry<"posts" | "projects">;
};
const { collection } = Astro.props;

View file

@ -1,8 +1,9 @@
---
import { Image } from "astro:assets";
import type { CollectionEntry } from "astro:content";
type Props = {
collection: any;
collection: CollectionEntry<"projects">;
};
const { collection } = Astro.props;

View file

@ -1,9 +1,10 @@
---
import { Image } from "astro:assets";
import type { CollectionEntry } from "astro:content";
interface Props {
interval?: number;
images: any;
images: CollectionEntry<"projects">[];
}
const { interval = 3000, images } = Astro.props;