diff --git a/src/components/blog/blog-category-filter.tsx b/src/components/blog/blog-category-filter.tsx
index 879701c..18792d9 100644
--- a/src/components/blog/blog-category-filter.tsx
+++ b/src/components/blog/blog-category-filter.tsx
@@ -1,10 +1,10 @@
import Container from '@/components/layout/container';
-import type { Category } from 'content-collections';
+import type { BlogCategory } from '@/types/blog-types';
import { BlogCategoryListDesktop } from './blog-category-list-desktop';
import { BlogCategoryListMobile } from './blog-category-list-mobile';
interface BlogCategoryFilterProps {
- categoryList: Category[];
+ categoryList: BlogCategory[];
}
export function BlogCategoryFilter({ categoryList }: BlogCategoryFilterProps) {
diff --git a/src/components/blog/blog-category-list-desktop.tsx b/src/components/blog/blog-category-list-desktop.tsx
index bf169a3..6f0444d 100644
--- a/src/components/blog/blog-category-list-desktop.tsx
+++ b/src/components/blog/blog-category-list-desktop.tsx
@@ -3,12 +3,12 @@
import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group';
import { LocaleLink } from '@/i18n/navigation';
import { cn } from '@/lib/utils';
-import type { Category } from 'content-collections';
+import type { BlogCategory } from '@/types/blog-types';
import { useTranslations } from 'next-intl';
import { useParams } from 'next/navigation';
export type BlogCategoryListDesktopProps = {
- categoryList: Category[];
+ categoryList: BlogCategory[];
};
export function BlogCategoryListDesktop({
diff --git a/src/components/blog/blog-category-list-mobile.tsx b/src/components/blog/blog-category-list-mobile.tsx
index 501a992..fa9daa2 100644
--- a/src/components/blog/blog-category-list-mobile.tsx
+++ b/src/components/blog/blog-category-list-mobile.tsx
@@ -9,14 +9,14 @@ import {
DrawerTitle,
DrawerTrigger,
} from '@/components/ui/drawer';
-import type { Category } from 'content-collections';
+import type { BlogCategory } from '@/types/blog-types';
import { LayoutListIcon } from 'lucide-react';
import { useTranslations } from 'next-intl';
import { useParams } from 'next/navigation';
import { useState } from 'react';
export type BlogCategoryListMobileProps = {
- categoryList: Category[];
+ categoryList: BlogCategory[];
};
export function BlogCategoryListMobile({
diff --git a/src/components/blog/blog-grid-with-pagination.tsx b/src/components/blog/blog-grid-with-pagination.tsx
index 77c892b..dbc1744 100644
--- a/src/components/blog/blog-grid-with-pagination.tsx
+++ b/src/components/blog/blog-grid-with-pagination.tsx
@@ -1,15 +1,17 @@
-import type { Post } from 'content-collections';
+import type { BlogType } from '@/lib/docs/source';
import EmptyGrid from '../shared/empty-grid';
import CustomPagination from '../shared/pagination';
import BlogGrid from './blog-grid';
interface BlogGridWithPaginationProps {
- posts: Post[];
+ locale: string;
+ posts: BlogType[];
totalPages: number;
routePrefix: string;
}
export default function BlogGridWithPagination({
+ locale,
posts,
totalPages,
routePrefix,
@@ -19,7 +21,7 @@ export default function BlogGridWithPagination({
{posts.length === 0 && }
{posts.length > 0 && (
-
+
{posts?.length > 0 && (
{posts.map((post) => (
-
+
))}
)}
diff --git a/src/types/blog-types.ts b/src/types/blog-types.ts
new file mode 100644
index 0000000..76f2b52
--- /dev/null
+++ b/src/types/blog-types.ts
@@ -0,0 +1,25 @@
+/**
+ * Blog Category
+ *
+ * we can not pass CategoryType from server component to client component
+ * so we need to define a new type, and use it in the client component
+ */
+export type BlogCategory = {
+ slug: string;
+ name: string;
+ description: string;
+};
+
+export type BlogAuthor = {
+ slug: string;
+ name: string;
+ description: string;
+ avatar: string;
+};
+
+export type BlogPost = {
+ slug: string;
+ title: string;
+ description: string;
+ date: string;
+};