fix: make it build
This commit is contained in:
@@ -7,10 +7,10 @@ import { Skeleton } from '@/components/ui/skeleton'
|
||||
import { getDb } from '@/lib/db'
|
||||
|
||||
interface PageProps {
|
||||
params: {
|
||||
params: Promise<{
|
||||
owner: string
|
||||
repo: string
|
||||
}
|
||||
}>
|
||||
}
|
||||
|
||||
async function getReadmeContent(owner: string, repo: string) {
|
||||
@@ -49,7 +49,8 @@ async function getReadmeContent(owner: string, repo: string) {
|
||||
}
|
||||
|
||||
export async function generateMetadata({ params }: PageProps): Promise<Metadata> {
|
||||
const data = await getReadmeContent(params.owner, params.repo)
|
||||
const { owner, repo } = await params
|
||||
const data = await getReadmeContent(owner, repo)
|
||||
|
||||
if (!data) {
|
||||
return {
|
||||
@@ -69,7 +70,8 @@ export async function generateMetadata({ params }: PageProps): Promise<Metadata>
|
||||
}
|
||||
|
||||
export default async function ReadmePage({ params }: PageProps) {
|
||||
const data = await getReadmeContent(params.owner, params.repo)
|
||||
const { owner, repo } = await params
|
||||
const data = await getReadmeContent(owner, repo)
|
||||
|
||||
if (!data) {
|
||||
notFound()
|
||||
|
||||
@@ -43,8 +43,6 @@ interface RepositoryDetailResponse {
|
||||
marked.use({
|
||||
breaks: true,
|
||||
gfm: true,
|
||||
headerIds: true,
|
||||
mangle: false,
|
||||
})
|
||||
|
||||
marked.use(
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
'use client'
|
||||
|
||||
import * as React from 'react'
|
||||
import { Suspense } from 'react'
|
||||
import { useSearchParams, useRouter } from 'next/navigation'
|
||||
import { Search, Star, Filter, SlidersHorizontal, ExternalLink } from 'lucide-react'
|
||||
import { Input } from '@/components/ui/input'
|
||||
@@ -50,7 +51,7 @@ interface StatsResponse {
|
||||
categories: { name: string; count: number }[]
|
||||
}
|
||||
|
||||
export default function SearchPage() {
|
||||
function SearchPageContent() {
|
||||
const searchParams = useSearchParams()
|
||||
const router = useRouter()
|
||||
|
||||
@@ -370,3 +371,11 @@ export default function SearchPage() {
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default function SearchPage() {
|
||||
return (
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<SearchPageContent />
|
||||
</Suspense>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user