SPB Git forge

spb/toveli

Public
14commits 1branches 0releases
1.1 MBsize
maindefault branch
2 h agolast push
TypeScript 50.6% JavaScript 46.1% SQL 2.1% Shell 0.6% CSS 0.5%
1.8 KB · 25 lines tsx
Raw Blame History
1import { ImageResponse } from "next/og";2import { dbAvailable, meta } from "@/lib/db";3export const runtime = "nodejs";4export const alt = "Toveli — propriétés à vendre et à louer au Québec";5export const size = { width: 1200, height: 630 };6export const contentType = "image/png";7export const dynamic = "force-dynamic";8export default function Image() {9  const sale = dbAvailable() ? Number(meta("listings_sale")) : 0, rent = dbAvailable() ? Number(meta("listings_rent")) : 0; const total = sale + rent;10  const f = (n: number) => n.toLocaleString("fr-CA");11  return new ImageResponse(12    (13      <div style={{ width: "100%", height: "100%", display: "flex", flexDirection: "column", justifyContent: "space-between", padding: 64, background: "linear-gradient(135deg,#ffffff 0%,#fdeef0 100%)", color: "#15181d", fontFamily: "Helvetica, Arial, sans-serif" }}>14        <div style={{ display: "flex", alignItems: "baseline", fontSize: 56, fontWeight: 800, letterSpacing: -2 }}>toveli<span style={{ color: "#e0263c" }}>.</span></div>15        <div style={{ display: "flex", flexDirection: "column" }}>16          <div style={{ display: "flex", alignItems: "baseline", gap: 20 }}><span style={{ fontSize: 132, fontWeight: 800, color: "#e0263c", letterSpacing: -4, lineHeight: 1 }}>{total ? f(total) : "—"}</span></div>17          <div style={{ fontSize: 44, fontWeight: 700, marginTop: 8 }}>propriétés à vendre et à louer au Québec</div>18          <div style={{ fontSize: 28, color: "#4b5260", marginTop: 12 }}>{total ? `${f(sale)} à vendre · ${f(rent)} à louer · mises à jour chaque nuit` : "L'immobilier, enfin réuni."}</div>19        </div>20        <div style={{ display: "flex", justifyContent: "space-between", fontSize: 26, color: "#7a8190" }}><span>Trouver. Comprendre. Décider.</span><span>www.toveli.ca</span></div>21      </div>22    ), { ...size },23  );24}25