|
|
|
@@ -17,7 +17,8 @@ export function getAccommodationsListProps(tripDetails: TripDetails) {
|
|
|
|
"https://a0.muscache.com/im/pictures/11bcbeec-749c-4897-8593-1ec6f6dc04ad.jpg?im_w=720&im_format=avif",
|
|
|
|
"https://a0.muscache.com/im/pictures/11bcbeec-749c-4897-8593-1ec6f6dc04ad.jpg?im_w=720&im_format=avif",
|
|
|
|
"https://a0.muscache.com/im/pictures/prohost-api/Hosting-18327626/original/fba2e4e8-9d68-47a8-838e-dab5353e5209.jpeg?im_w=720&im_format=avif",
|
|
|
|
"https://a0.muscache.com/im/pictures/prohost-api/Hosting-18327626/original/fba2e4e8-9d68-47a8-838e-dab5353e5209.jpeg?im_w=720&im_format=avif",
|
|
|
|
"https://a0.muscache.com/im/pictures/miso/Hosting-813949239894880001/original/b2abe806-b60f-4c0b-b4e6-46808024e5b6.jpeg?im_w=720&im_format=avif",
|
|
|
|
"https://a0.muscache.com/im/pictures/miso/Hosting-813949239894880001/original/b2abe806-b60f-4c0b-b4e6-46808024e5b6.jpeg?im_w=720&im_format=avif",
|
|
|
|
"https://a0.muscache.com/im/pictures/prohost-api/Hosting-894877242638354447/original/29e50d48-1733-4c5b-9068-da4443dd7757.jpeg?im_w=720&im_format=avif",,
|
|
|
|
"https://a0.muscache.com/im/pictures/prohost-api/Hosting-894877242638354447/original/29e50d48-1733-4c5b-9068-da4443dd7757.jpeg?im_w=720&im_format=avif",
|
|
|
|
|
|
|
|
,
|
|
|
|
"https://a0.muscache.com/im/pictures/hosting/Hosting-1079897686805296552/original/b24bd803-52f2-4ca7-9389-f73c9d9b3c64.jpeg?im_w=720&im_format=avif",
|
|
|
|
"https://a0.muscache.com/im/pictures/hosting/Hosting-1079897686805296552/original/b24bd803-52f2-4ca7-9389-f73c9d9b3c64.jpeg?im_w=720&im_format=avif",
|
|
|
|
"https://a0.muscache.com/im/pictures/miso/Hosting-43730011/original/29f90186-4f83-408a-89ce-a82e520b4e36.png?im_w=720&im_format=avif",
|
|
|
|
"https://a0.muscache.com/im/pictures/miso/Hosting-43730011/original/29f90186-4f83-408a-89ce-a82e520b4e36.png?im_w=720&im_format=avif",
|
|
|
|
"https://a0.muscache.com/im/pictures/300ae0e1-fc7e-4a05-93a4-26809311ef19.jpg?im_w=720&im_format=avif",
|
|
|
|
"https://a0.muscache.com/im/pictures/300ae0e1-fc7e-4a05-93a4-26809311ef19.jpg?im_w=720&im_format=avif",
|
|
|
|
@@ -37,20 +38,22 @@ export function getAccommodationsListProps(tripDetails: TripDetails) {
|
|
|
|
"https://a0.muscache.com/im/pictures/ecbfed18-29d0-4f86-b6aa-4325b076dfb3.jpg?im_w=720&im_format=avif",
|
|
|
|
"https://a0.muscache.com/im/pictures/ecbfed18-29d0-4f86-b6aa-4325b076dfb3.jpg?im_w=720&im_format=avif",
|
|
|
|
"https://a0.muscache.com/im/pictures/prohost-api/Hosting-52443635/original/05f084c6-60d0-4945-81ff-d23dfb89c3ca.jpeg?im_w=720&im_format=avif",
|
|
|
|
"https://a0.muscache.com/im/pictures/prohost-api/Hosting-52443635/original/05f084c6-60d0-4945-81ff-d23dfb89c3ca.jpeg?im_w=720&im_format=avif",
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
const getAccommodations = (city: string): Accommodation[] => {
|
|
|
|
const getAccommodations = (city: string): Accommodation[] => {
|
|
|
|
// Shuffle the image URLs array and take the first 6
|
|
|
|
// Shuffle the image URLs array and take the first 6
|
|
|
|
const shuffledImages = [...IMAGE_URLS]
|
|
|
|
const shuffledImages = [...IMAGE_URLS]
|
|
|
|
.sort(() => Math.random() - 0.5)
|
|
|
|
.sort(() => Math.random() - 0.5)
|
|
|
|
.slice(0, 6)
|
|
|
|
.slice(0, 6)
|
|
|
|
.filter((i): i is string => typeof i === "string")
|
|
|
|
.filter((i): i is string => typeof i === "string");
|
|
|
|
|
|
|
|
|
|
|
|
return Array.from({ length: 6 }, (_, index) => ({
|
|
|
|
return Array.from({ length: 6 }, (_, index) => ({
|
|
|
|
id: faker.string.uuid(),
|
|
|
|
id: faker.string.uuid(),
|
|
|
|
name: faker.location.streetAddress(),
|
|
|
|
name: faker.location.streetAddress(),
|
|
|
|
price: faker.number.int({ min: 100, max: 1000 }),
|
|
|
|
price: faker.number.int({ min: 100, max: 1000 }),
|
|
|
|
rating: Number(
|
|
|
|
rating: Number(
|
|
|
|
faker.number.float({ min: 4.0, max: 5.0, fractionDigits: 2 }).toFixed(2),
|
|
|
|
faker.number
|
|
|
|
|
|
|
|
.float({ min: 4.0, max: 5.0, fractionDigits: 2 })
|
|
|
|
|
|
|
|
.toFixed(2),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
city: city,
|
|
|
|
city: city,
|
|
|
|
image: shuffledImages[index],
|
|
|
|
image: shuffledImages[index],
|
|
|
|
@@ -60,5 +63,5 @@ export function getAccommodationsListProps(tripDetails: TripDetails) {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
tripDetails,
|
|
|
|
tripDetails,
|
|
|
|
accommodations: getAccommodations(tripDetails.location),
|
|
|
|
accommodations: getAccommodations(tripDetails.location),
|
|
|
|
}
|
|
|
|
};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|