feat: refactor code

This commit is contained in:
shinya
2025-06-29 20:36:03 +08:00
parent 0b0048209f
commit 5c8360d9dd
8 changed files with 40 additions and 95 deletions

View File

@@ -10,6 +10,7 @@ import {
clearSearchHistory,
getSearchHistory,
} from '@/lib/db.client';
import { SearchResult } from '@/lib/types';
import AggregateCard from '@/components/AggregateCard';
import PageLayout from '@/components/PageLayout';
@@ -19,20 +20,6 @@ function SearchPageClient() {
// 搜索历史
const [searchHistory, setSearchHistory] = useState<string[]>([]);
// 定义搜索结果类型
type SearchResult = {
id: string;
title: string;
poster: string;
source: string;
source_name: string;
episodes: string[];
year: string;
class?: string;
type_name?: string;
desc?: string;
};
const router = useRouter();
const searchParams = useSearchParams();
const [searchQuery, setSearchQuery] = useState('');