Files
web/apps/scandic-web/components/Blocks/DynamicContent/RewardNights/index.tsx
Matilda Landström 5770147af4 Merged in feat/LOY-501-table-sorting (pull request #3321)
feat(LOY-501): add sorting to Reward Night Table

* feat(LOY-501): add sorting using Tanstack Table


Approved-by: Chuma Mcphoy (We Ahead)
2025-12-11 14:08:01 +00:00

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} />
}