chore: move blog types to index
This commit is contained in:
parent
107f761716
commit
b17599976f
@ -1,5 +1,5 @@
|
||||
import Container from '@/components/layout/container';
|
||||
import type { BlogCategory } from '@/types/blog-types';
|
||||
import type { BlogCategory } from '@/types';
|
||||
import { BlogCategoryListDesktop } from './blog-category-list-desktop';
|
||||
import { BlogCategoryListMobile } from './blog-category-list-mobile';
|
||||
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group';
|
||||
import { LocaleLink } from '@/i18n/navigation';
|
||||
import { cn } from '@/lib/utils';
|
||||
import type { BlogCategory } from '@/types/blog-types';
|
||||
import type { BlogCategory } from '@/types';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { useParams } from 'next/navigation';
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ import {
|
||||
DrawerTitle,
|
||||
DrawerTrigger,
|
||||
} from '@/components/ui/drawer';
|
||||
import type { BlogCategory } from '@/types/blog-types';
|
||||
import type { BlogCategory } from '@/types';
|
||||
import { LayoutListIcon } from 'lucide-react';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { useParams } from 'next/navigation';
|
||||
|
||||
@ -1,25 +0,0 @@
|
||||
/**
|
||||
* 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;
|
||||
};
|
||||
12
src/types/index.d.ts
vendored
12
src/types/index.d.ts
vendored
@ -163,3 +163,15 @@ export type MenuItem = {
|
||||
export type NestedMenuItem = MenuItem & {
|
||||
items?: MenuItem[]; // The items to display in the nested menu
|
||||
};
|
||||
|
||||
/**
|
||||
* 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;
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user