diff --git a/components/postPreview.tsx b/components/postPreview.tsx index 66c5193..774da25 100644 --- a/components/postPreview.tsx +++ b/components/postPreview.tsx @@ -1,7 +1,10 @@ +"use client"; import styles from "./postPreview.module.css"; import Image from "next/image"; import Link from "next/link"; import { useRouter } from "next/navigation"; +import React from "react"; + type Items = { [key: string]: string; @@ -10,6 +13,10 @@ type Items = { export default function PostPreview({ post }: { post: Items }) { const router = useRouter(); + React.useEffect(() => { + router.push(`/blog/${post.slug}`); + }); + return (
{post.title} @@ -18,4 +25,3 @@ export default function PostPreview({ post }: { post: Items }) {
); } -