diff --git a/app/(main)/community/page.tsx b/app/(main)/community/page.tsx index abae0b0..42c54b8 100644 --- a/app/(main)/community/page.tsx +++ b/app/(main)/community/page.tsx @@ -4,6 +4,7 @@ import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar" import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Card, CardContent, CardFooter, CardHeader } from "@/components/ui/card" +import { EmptyState } from "@/components/ui/empty-state" import { listGames, listPosts } from "@/lib/api" import { roleLabels } from "@/lib/constants" import type { Game, Post } from "@/lib/types" @@ -86,14 +87,15 @@ export default function CommunityPage() {
{games.map((game) => ( - setSelectedGame(selectedGame === game.name ? null : game.name)} > {game.name} - + ))}
@@ -102,11 +104,11 @@ export default function CommunityPage() { {postsLoading ? (
加载中...
) : filteredPosts.length === 0 ? ( -
暂无帖子
+ ) : ( filteredPosts.map((post) => ( - +
@@ -142,7 +144,9 @@ export default function CommunityPage() { - + {post.likeCount} diff --git a/app/(main)/page.tsx b/app/(main)/page.tsx index beec46c..44f5e6b 100644 --- a/app/(main)/page.tsx +++ b/app/(main)/page.tsx @@ -5,6 +5,7 @@ import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Card, CardContent, CardFooter, CardHeader, CardTitle } from "@/components/ui/card" import { IconInput } from "@/components/ui/icon-input" +import { StatusBadge } from "@/components/ui/status-badge" import { listGames, listPlayers, listShops } from "@/lib/api" import { toApiError } from "@/lib/errors" import { GameIcon } from "@/lib/game-icons" @@ -55,10 +56,7 @@ export default function HomePage() {
-

+

找到你的游戏搭档

@@ -74,7 +72,7 @@ export default function HomePage() { type="text" name="q" placeholder="搜索陪玩、店铺、游戏..." - className="w-full border-border bg-card shadow-card transition-shadow focus:shadow-card-hover" + className="w-full border-border bg-card shadow-sm transition-shadow focus-visible:shadow-md" />

@@ -140,10 +138,7 @@ export default function HomePage() { {/* Players */} {!loading && !loadingError ? players.map((player) => ( - + @@ -153,22 +148,29 @@ export default function HomePage() { {player.user.nickname}
- + {player.rating}
{player.totalOrders} 单 - {player.status === "available" ? "可接单" : player.status === "busy" ? "忙碌" : "离线"} - +
@@ -208,7 +210,7 @@ export default function HomePage() { : null} {/* Community Teaser */} - + 逛逛社区

发现更多有趣的游戏日常和讨论

@@ -228,10 +230,7 @@ export default function HomePage() { {/* Shops */} {!loading && !loadingError ? shops.map((shop) => ( - + {shop.name}

{shop.description}

@@ -239,7 +238,7 @@ export default function HomePage() {
- + {shop.rating}
diff --git a/app/(main)/search/page.tsx b/app/(main)/search/page.tsx index ef5a36b..b431807 100644 --- a/app/(main)/search/page.tsx +++ b/app/(main)/search/page.tsx @@ -5,6 +5,7 @@ import { Badge } from "@/components/ui/badge" import { Button } from "@/components/ui/button" import { Card, CardContent, CardFooter, CardHeader } from "@/components/ui/card" import { Checkbox } from "@/components/ui/checkbox" +import { EmptyState } from "@/components/ui/empty-state" import { IconInput } from "@/components/ui/icon-input" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" @@ -26,6 +27,7 @@ import { SheetTitle, SheetTrigger, } from "@/components/ui/sheet" +import { StatusBadge } from "@/components/ui/status-badge" import { Switch } from "@/components/ui/switch" import { listGames } from "@/lib/api" import { searchCatalog } from "@/lib/api/search" @@ -33,18 +35,7 @@ import { GameIcon } from "@/lib/game-icons" import type { SearchResponse, SearchResultItem, SearchSort } from "@/lib/search/types" import type { Game, Player } from "@/lib/types" import { cn } from "@/lib/utils" -import { - CheckCircle2, - Clock, - Filter, - Gamepad2, - Search, - SlidersHorizontal, - Star, - Store, - User, - XCircle, -} from "lucide-react" +import { Filter, Gamepad2, Search, SlidersHorizontal, Star, Store, User } from "lucide-react" import Link from "next/link" import { useRouter, useSearchParams } from "next/navigation" import { Suspense, useCallback, useEffect, useState } from "react" @@ -70,34 +61,6 @@ function resetPagination(params: URLSearchParams) { params.set("offset", "0") } -function StatusBadge({ status }: { status: Player["status"] }) { - switch (status) { - case "available": - return ( - - - 可接单 - - ) - case "busy": - return ( - - - 忙碌中 - - ) - case "offline": - return ( - - - 离线 - - ) - default: - return null - } -} - function PlayerCard({ player }: { player: Player }) { const minPrice = !player.services || player.services.length === 0 @@ -111,7 +74,7 @@ function PlayerCard({ player }: { player: Player }) { return ( - +
@@ -122,26 +85,43 @@ function PlayerCard({ player }: { player: Player }) {

{player.user.nickname}

{player.shopName ? ( - + {player.shopName} - + ) : ( - + 个人 - + )}
- + + {player.status === "available" + ? "可接单" + : player.status === "busy" + ? "忙碌中" + : "离线"} +
-
- +
+ {player.rating.toFixed(1)}
接单 {player.totalOrders}
@@ -194,7 +174,7 @@ type ShopSearchItem = Extract function ShopCard({ item }: { item: ShopSearchItem }) { return ( - +
@@ -204,20 +184,22 @@ function ShopCard({ item }: { item: ShopSearchItem }) {

{item.shop.name}

- + 店铺 - +
- + + {item.hasAvailable ? "可接单" : "忙碌中"} +
-
- +
+ {item.shop.rating}
接单 {item.shop.totalOrders}
@@ -585,7 +567,7 @@ function SearchPageContent() { icon={} type="search" placeholder="搜索陪玩、游戏、标签..." - className="border-border bg-card shadow-card transition-shadow focus:shadow-card-hover" + className="border-border bg-card shadow-sm transition-shadow focus-visible:shadow-md" value={searchQuery} onChange={(e) => setSearchQuery(e.target.value)} /> @@ -730,24 +712,20 @@ function SearchPageContent() { ))}
) : ( -
-
- -
-

未找到相关陪玩

-

- {error ? "请求失败,请稍后重试" : "尝试调整筛选条件或更换搜索关键词"} -

- -
+ clearAllFilters()} + > + 清除所有筛选 + + } + /> )} {canLoadMore && (