← Files WixARCHIVED FILE

skills/wix-headless-templates/rentals/app-astro/pages/rentals.astro

884 Bytes · Oct 10, 2026 · 12:03 UTC

↓ Download file

---
// Rentals listing — the first page fetched SERVER-SIDE (SEO) and handed to the island as DTO
// props. Keep this frontmatter; swap the island import to YOUR listing component.
import SiteLayout from "../layouts/SiteLayout.astro";
import RentalsView from "../components/rentals/RentalsView";
import { fetchRentals } from "../wix/rentals/rentals";
import type { RentalSummary } from "../wix/rentals/types";

let rentals: RentalSummary[] = [];
let hasMore = false;
try {
  const page = await fetchRentals();
  rentals = page.items;
  hasMore = page.hasMore;
} catch {
  // An unguarded SSR throw truncates the response mid-stream; the island renders the
  // empty state instead.
}
---

<SiteLayout title="Rentals">
  <h1 class="mb-8 text-2xl font-semibold tracking-tight">Rentals</h1>
  <RentalsView client:load initialRentals={rentals} initialHasMore={hasMore} />
</SiteLayout>

SHA-256: f2fed51a1b74767c5382ace906e49b931984c86e071ca7e684165812f7680c09