SPB Git

Repository Public

NewsList.tsx 2.9 KB 70 lines tsx

1/**2 * =============================================================================3 *                  SP BOUCHER | SOFTWARE & RESEARCH4 *             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * Project          : ORIX App Universe8 * File             : src/components/apps/NewsList.tsx9 * Module           : components10 * Repository       : https://git.spboucher.ai/orix-spboucher-ai11 * Project Website  : https://www.orixlab.dev12 * Created          : 2026-11-2113 * Last Modified    : 2026-11-2114 *15 * Author           : Simon-Pierre Boucher16 * Position         : Professor of Finance17 * Institution      : Université du Québec en Outaouais (UQO)18 * Organization     : SP Boucher19 * Website          : https://spboucher.ai20 * Git              : https://git.spboucher.ai21 *22 * Preferred Contact: support@spboucher.ai23 * Development      : dev@spboucher.ai24 * Support          : support@spboucher.ai25 * Security/Admin   : admin@spboucher.ai26 *27 * Copyright (c) 202628 * Simon-Pierre Boucher29 * All rights reserved where applicable. This file is governed by the30 * applicable project license, copyright notices and relevant law.31 * Existing third-party rights and notices remain unaffected.32 *33 * License          : None specified (no license file in this repository)34 *35 * Do not embed credentials, private keys, access tokens,36 * certificates or confidential personal information.37 *38 * =============================================================================39 * END OF SP BOUCHER SOURCE HEADER40 * =============================================================================41 */4243import Link from "next/link";44import type { FeedItem } from "@/lib/news";45import { dict, fmtDate, type Locale } from "@/lib/i18n";46import { AppIcon } from "../ui/AppIcon";4748export function NewsList({ items, locale }: { items: FeedItem[]; locale: Locale }) {49  const t = dict(locale);50  return (51    <ol className="rule" data-testid="news-list">52      {items.map((n) => (53        <li key={n.key} className="grid gap-x-6 gap-y-3 border-b border-line py-7 sm:grid-cols-[11rem_1fr]">54          <div>55            <time dateTime={n.date} className="mono text-[0.78rem] text-ink3">{fmtDate(n.date, locale)}</time>56            <p className="mt-2"><span className="tag">{t.news.kinds[n.kind] ?? n.kind}</span></p>57          </div>58          <div className="flex gap-4">59            {n.appName && <AppIcon name={n.appName} src={n.icon} size={44} className="mt-0.5 self-start" />}60            <div>61              <h3 className="text-[1.08rem] font-semibold leading-snug tracking-tight">{n.href ? <Link href={n.href} className="hover:underline">{n.title}</Link> : n.title}</h3>62              {n.body.map((b, i) => <p key={i} className="mt-1.5 text-[0.96rem] text-ink2">{b}</p>)}63            </div>64          </div>65        </li>66      ))}67    </ol>68  );69}70
Files main
Menu

Theme