feat(LOY-501): add sorting to Reward Night Table * feat(LOY-501): add sorting using Tanstack Table Approved-by: Chuma Mcphoy (We Ahead)
20 lines
523 B
TypeScript
20 lines
523 B
TypeScript
import { getAllHotelData } from "@/lib/trpc/memoizedRequests"
|
|
|
|
import { RewardNightsTable } from "./Table"
|
|
|
|
import type { HotelData } from "./util"
|
|
|
|
export async function RewardNights() {
|
|
const hotelData = await getAllHotelData()
|
|
|
|
const rewardNightsData: HotelData[] = hotelData.map(({ url, hotel }) => ({
|
|
url: url ?? "",
|
|
name: hotel.name,
|
|
city: hotel.address.city,
|
|
country: hotel.address.country,
|
|
rewardNight: hotel.rewardNight,
|
|
}))
|
|
|
|
return <RewardNightsTable hotelData={rewardNightsData} />
|
|
}
|