Merge pull request #391 from saicaca/390-fix-entry-type-is-any
refactor: replace 'any' type with CollectionEntry
This commit is contained in:
commit
8a6f7fab16
2 changed files with 19 additions and 20 deletions
|
|
@ -1,5 +1,6 @@
|
|||
---
|
||||
import path from "node:path";
|
||||
import type { CollectionEntry } from "astro:content";
|
||||
import { Icon } from "astro-icon/components";
|
||||
import I18nKey from "../i18n/i18nKey";
|
||||
import { i18n } from "../i18n/translation";
|
||||
|
|
@ -9,8 +10,7 @@ import ImageWrapper from "./misc/ImageWrapper.astro";
|
|||
|
||||
interface Props {
|
||||
class?: string;
|
||||
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
||||
entry: any;
|
||||
entry: CollectionEntry<"posts">;
|
||||
title: string;
|
||||
url: string;
|
||||
published: Date;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
---
|
||||
import type { CollectionEntry } from "astro:content";
|
||||
import { getPostUrlBySlug } from "@utils/url-utils";
|
||||
import PostCard from "./PostCard.astro";
|
||||
|
||||
|
|
@ -8,8 +9,7 @@ let delay = 0;
|
|||
const interval = 50;
|
||||
---
|
||||
<div class="transition flex flex-col rounded-[var(--radius-large)] bg-[var(--card-bg)] py-1 md:py-0 md:bg-transparent md:gap-4 mb-4">
|
||||
{page.data.map((entry: { data: { draft: boolean; title: string; tags: string[]; category: string; published: Date; image: string; description: string; updated: Date; }; slug: string; }) => {
|
||||
return (
|
||||
{page.data.map((entry: CollectionEntry<"posts">) => (
|
||||
<PostCard
|
||||
entry={entry}
|
||||
title={entry.data.title}
|
||||
|
|
@ -24,6 +24,5 @@ const interval = 50;
|
|||
class:list="onload-animation"
|
||||
style={`animation-delay: calc(var(--content-delay) + ${delay++ * interval}ms);`}
|
||||
></PostCard>
|
||||
);
|
||||
})}
|
||||
))}
|
||||
</div>
|
||||
Loading…
Reference in a new issue