SPB Git

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%
964 B · 42 lines tsx
Raw Blame History
1/**2 * Trouve-KA — favicon d'un domaine (icônes DuckDuckGo, repli neutre)3 * Author: Simon-Pierre Boucher4 * Contact: contact@spboucher.ai5 */67"use client";89import { useState } from "react";1011interface FaviconProps {12  domain: string;13}1415/** Petit favicon décoratif d'un domaine; repli sur une pastille neutre. */16export function Favicon({ domain }: FaviconProps) {17  const [failed, setFailed] = useState(false);1819  if (failed || !domain) {20    return (21      <span22        aria-hidden="true"23        className="inline-block h-4 w-4 shrink-0 rounded-sm border border-line bg-surface-2"24      />25    );26  }2728  return (29    // eslint-disable-next-line @next/next/no-img-element30    <img31      src={`https://icons.duckduckgo.com/ip3/${encodeURIComponent(domain)}.ico`}32      alt=""33      aria-hidden="true"34      width={16}35      height={16}36      loading="lazy"37      className="h-4 w-4 shrink-0 rounded-sm"38      onError={() => setFailed(true)}39    />40  );41}42