feat(search): add api-backed filtering and sorting

This commit is contained in:
zetaloop
2026-02-25 04:29:17 +08:00
parent a1f3ea3914
commit 14717f1340
7 changed files with 806 additions and 190 deletions
+28
View File
@@ -0,0 +1,28 @@
import type { Player, PlayerService, Shop } from "@/lib/types"
export type SearchSort = "composite" | "rating" | "orders" | "price_asc" | "price_desc"
export type SearchResultItem =
| {
type: "player"
player: Player
minPrice: number
unit: PlayerService["unit"]
rating: number
orders: number
}
| {
type: "shop"
shop: Shop
minPrice: number
unit: PlayerService["unit"]
rating: number
orders: number
games: string[]
hasAvailable: boolean
}
export interface SearchResponse {
items: SearchResultItem[]
meta: { total: number; offset: number; limit: number }
}