File tree 3 files changed +13
-5
lines changed
3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change 1
1
import ArticleBlock from "@components/ArticleBlock" ;
2
2
import { posts , Post } from "@content" ;
3
3
import { Metadata } from "next" ;
4
- import TagFilteredList from "@/ components/TagFilteredList" ;
5
- import { Tag } from "@components/Tag" ;
4
+ import TagFilteredList from "@components/TagFilteredList" ;
5
+ import Tag from "@components/Tag" ;
6
6
7
7
export const metadata : Metadata = {
8
8
title : "Share" ,
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import React from "react";
2
2
import { format } from "date-fns" ;
3
3
import Link from "next/link" ;
4
4
import { CalendarIcon } from "./icons/CalendarIcon" ;
5
- import { Tag } from "@components/Tag" ;
5
+ import Tag from "@components/Tag" ;
6
6
7
7
interface ArticleBlockProps {
8
8
slug : string ;
Original file line number Diff line number Diff line change 1
1
"use client" ;
2
2
3
- import Link from "next/link" ;
4
3
import { usePathname , useRouter , useSearchParams } from "next/navigation" ;
4
+ import { Suspense } from "react" ;
5
5
6
6
interface TagProps {
7
7
tag : string ;
@@ -12,7 +12,7 @@ interface TagProps {
12
12
* A tag component that can be used to filter content by tag.
13
13
* If no children are provided, the tag string will be displayed.
14
14
*/
15
- export function Tag ( { tag, children } : TagProps ) {
15
+ function SuspenseTag ( { tag, children } : TagProps ) {
16
16
const searchParams = useSearchParams ( ) ;
17
17
const pathname = usePathname ( ) ;
18
18
const { replace } = useRouter ( ) ;
@@ -50,3 +50,11 @@ export function Tag({ tag, children }: TagProps) {
50
50
</ button >
51
51
) ;
52
52
}
53
+
54
+ export default function Tag ( { tag, children } : TagProps ) {
55
+ return (
56
+ < Suspense >
57
+ < SuspenseTag tag = { tag } > { children } </ SuspenseTag >
58
+ </ Suspense >
59
+ ) ;
60
+ }
You can’t perform that action at this time.
0 commit comments