Repository Public
1// Page introuvable.23import { useState, type FormEvent } from "react";4import { Link, useNavigate } from "react-router";5import { Search } from "lucide-react";6import { useTitle } from "@/lib/hooks";7import { LoukaEmptyState } from "@/brand/EmptyState";89const LINKS = [10 { to: "/recherche", title: "Carte des logements", text: "Tout le Québec" },11 { to: "/villes", title: "Par ville", text: "Loyers et offre" },12 { to: "/stats", title: "Marché locatif", text: "Tendances et loyers" },13 { to: "/favoris", title: "Mes favoris", text: "Vos logements mis de côté" },14];1516export default function NotFound() {17 useTitle("Page introuvable");18 const navigate = useNavigate();19 const [q, setQ] = useState("");20 const submit = (e: FormEvent) => {21 e.preventDefault();22 navigate(q.trim() ? `/recherche?q=${encodeURIComponent(q.trim())}` : "/recherche");23 };24 return (25 <section className="container-x flex min-h-[calc(100dvh-16rem)] flex-col items-center justify-center py-10">26 <LoukaEmptyState27 kind="closed"28 title="Cette porte ne mène nulle part"29 text="La page n'existe pas : le logement a peut-être été loué, ou le lien est incomplet (erreur 404)."30 className="py-6"31 />32 <form onSubmit={submit} role="search" className="flex w-full max-w-md overflow-hidden rounded-[12px] border border-line-2 bg-surface focus-within:border-brand">33 <label className="flex min-w-0 flex-1 items-center gap-2.5 pl-3.5">34 <Search className="size-[18px] shrink-0 text-ink-3" />35 <input36 value={q}37 onChange={(e) => setQ(e.target.value)}38 placeholder="Ville, quartier, adresse"39 aria-label="Chercher un logement"40 className="h-13 w-full min-w-0 bg-transparent text-[1rem] text-ink outline-none placeholder:text-ink-3"41 />42 </label>43 <button type="submit" className="m-1.5 h-10 shrink-0 rounded-[8px] bg-brand px-4 text-[0.92rem] font-medium text-brand-ink transition-colors duration-150 hover:bg-brand-strong">44 Chercher45 </button>46 </form>47 <ul className="mt-8 grid w-full max-w-md grid-cols-1 sm:max-w-2xl sm:grid-cols-2 sm:gap-x-12">48 {LINKS.map(({ to, title, text }) => (49 <li key={to}>50 <Link to={to} className="group flex min-h-11 items-baseline justify-between gap-4 border-b border-line py-3 hover:border-ink-3">51 <span className="text-[0.96rem] group-hover:text-brand">{title}</span>52 <span className="text-[0.84rem] text-ink-3">{text}</span>53 </Link>54 </li>55 ))}56 </ul>57 <Link to="/" className="mt-7 inline-flex min-h-11 items-center text-[0.9rem] text-ink-3 underline decoration-line-2 underline-offset-[3px] hover:text-ink">58 Retour à l'accueil59 </Link>60 </section>61 );62}63