mirror of
https://github.com/ChenQihan666/MyBlog-Next.git
synced 2026-08-14 11:29:33 +08:00
refactor: use astro generated CollectionEntry type
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
import { slugifyStr } from "@utils/slugify";
|
||||
import Datetime from "./Datetime";
|
||||
import type { BlogFrontmatter } from "@content/_schemas";
|
||||
import type { CollectionEntry } from "astro:content";
|
||||
|
||||
export interface Props {
|
||||
href?: string;
|
||||
frontmatter: BlogFrontmatter;
|
||||
frontmatter: CollectionEntry<"blog">["data"];
|
||||
secHeading?: boolean;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,12 +2,12 @@ import Fuse from "fuse.js";
|
||||
import { useEffect, useRef, useState, useMemo } from "react";
|
||||
import Card from "@components/Card";
|
||||
import slugify from "@utils/slugify";
|
||||
import type { BlogFrontmatter } from "@content/_schemas";
|
||||
import type { CollectionEntry } from "astro:content";
|
||||
|
||||
export type SearchItem = {
|
||||
title: string;
|
||||
description: string;
|
||||
data: BlogFrontmatter;
|
||||
data: CollectionEntry<"blog">["data"];
|
||||
};
|
||||
|
||||
interface Props {
|
||||
|
||||
Reference in New Issue
Block a user