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>
|
||||
)
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ export function CommandMenu({ open, setOpen }: CommandMenuProps) {
|
||||
const fetchData = React.useCallback(async () => {
|
||||
const response = await fetch(`/api/search?q=${encodeURIComponent(search)}`)
|
||||
const data = await response.json()
|
||||
setResults(...data.results);
|
||||
setResults(data.results);
|
||||
}, [])
|
||||
|
||||
React.useEffect(() => {
|
||||
|
||||
@@ -1282,7 +1282,6 @@ export const EditorFormatUnderline = ({
|
||||
|
||||
return (
|
||||
<BubbleMenuButton
|
||||
// @ts-expect-error "TipTap extensions are not typed"
|
||||
command={() => editor.chain().focus().toggleUnderline().run()}
|
||||
hideName={hideName}
|
||||
icon={UnderlineIcon}
|
||||
@@ -1343,7 +1342,6 @@ export const EditorLinkSelector = ({
|
||||
const href = getUrlFromString(url);
|
||||
|
||||
if (href) {
|
||||
// @ts-expect-error "TipTap extensions are not typed"
|
||||
editor.chain().focus().setLink({ href }).run();
|
||||
onOpenChange?.(false);
|
||||
}
|
||||
@@ -1388,7 +1386,6 @@ export const EditorLinkSelector = ({
|
||||
<Button
|
||||
className="flex h-8 items-center rounded-sm p-1 text-destructive transition-all hover:bg-destructive-foreground dark:hover:bg-destructive"
|
||||
onClick={() => {
|
||||
// @ts-expect-error "TipTap extensions are not typed"
|
||||
editor.chain().focus().unsetLink().run();
|
||||
onOpenChange?.(false);
|
||||
}}
|
||||
|
||||
22
eslint.config.mjs
Normal file
22
eslint.config.mjs
Normal file
@@ -0,0 +1,22 @@
|
||||
import { dirname } from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
import { FlatCompat } from "@eslint/eslintrc";
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = dirname(__filename);
|
||||
|
||||
const compat = new FlatCompat({
|
||||
baseDirectory: __dirname,
|
||||
});
|
||||
|
||||
const eslintConfig = [
|
||||
...compat.extends("next/core-web-vitals", "next/typescript"),
|
||||
{
|
||||
rules: {
|
||||
"@typescript-eslint/no-unused-vars": "off",
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
export default eslintConfig;
|
||||
@@ -70,13 +70,14 @@
|
||||
"zustand": "^4.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/eslintrc": "^3.3.1",
|
||||
"@types/better-sqlite3": "^7.6.9",
|
||||
"@types/node": "^20",
|
||||
"@types/react": "^18",
|
||||
"@types/react-dom": "^18",
|
||||
"autoprefixer": "^10.4.18",
|
||||
"eslint": "^8",
|
||||
"eslint-config-next": "14.2.0",
|
||||
"eslint": "^9.38.0",
|
||||
"eslint-config-next": "16.0.0",
|
||||
"shadcn": "^3.5.0",
|
||||
"tw-animate-css": "^1.4.0",
|
||||
"typescript": "^5"
|
||||
|
||||
781
pnpm-lock.yaml
generated
781
pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user