chore: wire StayConstraints + minStayNights dans carbet-card + search (oubli PR#30)
This commit is contained in:
parent
fdf66bfc74
commit
a7761ca323
2 changed files with 17 additions and 0 deletions
|
|
@ -4,6 +4,7 @@ import type { CarbetSearchResult } from "@/lib/carbet-search";
|
|||
import { formatPirogueDuration, truncate } from "@/lib/format";
|
||||
import { formatAverageRating } from "@/lib/reviews";
|
||||
import { AccessTypeBadge } from "@/components/AccessTypeBadge";
|
||||
import { StayConstraints } from "@/components/StayConstraints";
|
||||
|
||||
import { StarRating } from "./star-rating";
|
||||
|
||||
|
|
@ -41,6 +42,13 @@ export function CarbetCard({ carbet }: { carbet: CarbetSearchResult }) {
|
|||
Fleuve {carbet.river} · {carbet.capacity} voyageur
|
||||
{carbet.capacity > 1 ? "s" : ""}
|
||||
</p>
|
||||
<div className="mt-1 flex flex-wrap gap-1">
|
||||
<StayConstraints
|
||||
minNights={carbet.minStayNights}
|
||||
maxNights={carbet.maxStayNights}
|
||||
minCapacity={carbet.minCapacity}
|
||||
/>
|
||||
</div>
|
||||
{carbet.reviewCount > 0 && carbet.averageRating !== null ? (
|
||||
<p className="mt-1 flex items-center gap-1.5 text-xs text-zinc-600">
|
||||
<StarRating value={carbet.averageRating} className="text-sm" />
|
||||
|
|
|
|||
|
|
@ -82,6 +82,9 @@ export type CarbetSearchResult = {
|
|||
accessType: AccessType;
|
||||
roadAccessNote: string | null;
|
||||
capacity: number;
|
||||
minStayNights: number | null;
|
||||
maxStayNights: number | null;
|
||||
minCapacity: number | null;
|
||||
description: string;
|
||||
coverUrl: string | null;
|
||||
mediaCount: number;
|
||||
|
|
@ -142,6 +145,9 @@ export async function searchCarbets(
|
|||
accessType: true,
|
||||
roadAccessNote: true,
|
||||
capacity: true,
|
||||
minStayNights: true,
|
||||
maxStayNights: true,
|
||||
minCapacity: true,
|
||||
description: true,
|
||||
media: {
|
||||
orderBy: { sortOrder: "asc" },
|
||||
|
|
@ -169,6 +175,9 @@ export async function searchCarbets(
|
|||
accessType: carbet.accessType,
|
||||
roadAccessNote: carbet.roadAccessNote,
|
||||
capacity: carbet.capacity,
|
||||
minStayNights: carbet.minStayNights,
|
||||
maxStayNights: carbet.maxStayNights,
|
||||
minCapacity: carbet.minCapacity,
|
||||
description: carbet.description,
|
||||
coverUrl: carbet.media[0]?.s3Url ?? null,
|
||||
mediaCount: carbet._count.media,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue