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%
1.9 KB · 62 lines tsx
Raw Blame History
1/**2 * Trouve-KA — table des domaines les plus indexés3 * Author: Simon-Pierre Boucher4 * Contact: contact@spboucher.ai5 */67import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";8import { formatNumber } from "@/lib/format";9import type { AdminOverview } from "@/lib/types";1011interface TopDomainsProps {12  domains: AdminOverview["top_domains"];13}1415export function TopDomains({ domains }: TopDomainsProps) {16  return (17    <Card>18      <CardHeader>19        <CardTitle>Domaines les plus actifs</CardTitle>20      </CardHeader>21      <CardContent>22        {domains.length === 0 ? (23          <p className="text-sm text-ink-2">Aucun domaine pour l'instant.</p>24        ) : (25          <table className="src-table">26            <caption className="sr-only">27              Domaines les plus actifs, avec le nombre de pages indexées et le28              score Québec29            </caption>30            <thead>31              <tr>32                <th scope="col">Domaine</th>33                <th scope="col" className="!text-right">34                  Pages35                </th>36                <th scope="col" className="!text-right">37                  Score Québec38                </th>39              </tr>40            </thead>41            <tbody>42              {domains.map((domain) => (43                <tr key={domain.domain}>44                  <td className="max-w-0 truncate text-ink">45                    {domain.domain}46                  </td>47                  <td className="gk-mono text-right tabular-nums text-ink-2">48                    {formatNumber(domain.pages)}49                  </td>50                  <td className="gk-mono text-right tabular-nums text-ink-2">51                    {domain.quebec_score.toFixed(2)}52                  </td>53                </tr>54              ))}55            </tbody>56          </table>57        )}58      </CardContent>59    </Card>60  );61}62