feat(search): add api-backed filtering and sorting
This commit is contained in:
@@ -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 }
|
||||
}
|
||||
Reference in New Issue
Block a user