feat: use getHotel data

This commit is contained in:
Fredrik Thorsson
2024-07-09 16:36:37 +02:00
parent 54daa1735a
commit 286d772de1
6 changed files with 31 additions and 81 deletions

View File

@@ -1,67 +1,26 @@
import { serverClient } from "@/lib/trpc/server"
import HotelCard from "@/components/HotelReservation/SelectHotel/HotelCard"
import { HotelCardData } from "@/components/HotelReservation/SelectHotel/HotelCard/data"
import styles from "./layout.module.css"
import styles from "./page.module.css"
export default function SelectHotelPage() {
const hotelData: HotelCardData[] = [
{
hotel: {
name: "Helsinki Hub",
address: "Kaisaniemenkatu 7, Helsinki",
description:
"Modern urban hotel in a impressive 1920s printing house in Helsinki city centre.",
rooms: "Only 4 rooms left",
button: "Book from 1549 SEK/night",
label: [
"Free cancellation until 18:00",
"Breakfast included",
"Free WiFi",
"Pay at the hotel",
],
},
},
{
hotel: {
name: "Stockholm Serenity",
address: "Drottninggatan 99, Stockholm",
description:
"Charming boutique hotel located in the heart of Stockholm with scenic city views.",
rooms: "Only 2 rooms left",
button: "Book from 1899 SEK/night",
label: [
"Free cancellation until 18:00",
"Breakfast included",
"Free WiFi",
"Fitness center",
"Pet friendly",
],
},
},
{
hotel: {
name: "Copenhagen Comfort",
address: "Vesterbrogade 23, Copenhagen",
description:
"Elegant hotel offering modern amenities and quick access to Copenhagen's main attractions.",
rooms: "Only 3 rooms left",
button: "Book from 1725 SEK/night",
label: [
"Free cancellation until 18:00",
"Breakfast included",
"Free WiFi",
"24-hour front desk",
"Airport shuttle",
],
},
},
]
import { LangParams, PageArgs } from "@/types/params"
export default async function SelectHotelPage({
params,
}: PageArgs<LangParams>) {
const hotel = await serverClient().hotel.getHotel({
hotelId: "Stockholm",
language: params.lang,
})
const hotels = [hotel]
return (
<main>
<section className={styles.section}>
{hotelData.map((data) => (
<HotelCard key={data.hotel.name} hotel={data.hotel} />
{hotels.map((hotel) => (
<HotelCard key={hotel.name} hotel={hotel} />
))}
</section>
</main>