spb/trouve-ka Public
Trouve-KA — moteur de recherche web indépendant, Québec-first. Crawler distribué, index OpenSearch, ranking bilingue, galerie d'images. En prod : www.trouve-ka.com
Python 76.8%
TypeScript 15.7%
SQL 3.9%
Shell 1.4%
CSS 1.3%
Dockerfile 0.7%
1/**2 * Trouve-KA — vignette d'un résultat de recherche (og:image hotlinkée)3 * Author: Simon-Pierre Boucher4 * Contact: contact@spboucher.ai5 *6 * Repli silencieux : si l'image 404 ou refuse le hotlink, le bloc disparaît7 * entièrement (jamais d'icône cassée). `<img>` natif — domaines arbitraires,8 * donc pas de next/image.9 */1011"use client";1213import { useState } from "react";1415interface ResultThumbnailProps {16 src: string;17 /** URL du résultat : la vignette est cliquable mais hors tabulation. */18 href: string;19}2021export function ResultThumbnail({ src, href }: ResultThumbnailProps) {22 const [failed, setFailed] = useState(false);2324 if (failed) return null;2526 return (27 <a28 href={href}29 tabIndex={-1}30 aria-hidden="true"31 className="shrink-0 self-start"32 >33 {/* eslint-disable-next-line @next/next/no-img-element */}34 <img35 src={src}36 alt=""37 loading="lazy"38 decoding="async"39 referrerPolicy="no-referrer"40 onError={() => setFailed(true)}41 className="h-[76px] w-[76px] rounded-card border-[1.5px] border-ink bg-surface-2 object-cover shadow-[3px_3px_0_rgba(20,24,20,0.12)] transition-[transform,box-shadow] duration-150 group-hover:-translate-x-px group-hover:-translate-y-px group-hover:shadow-[4px_4px_0_rgba(20,24,20,0.2)] sm:h-[110px] sm:w-[110px]"42 />43 </a>44 );45}46