- **Motivations :** Assurer passage du lint strict et clarifier la logique paiements/publications. - **Root causes :** Fonctions trop longues, promesses non gérées et typages WebLN/Nostr incomplets. - **Correctifs :** Refactor PaymentModal (handlers void), extraction helpers articlePublisher, simplification polling sponsoring/zap, corrections curly et awaits. - **Evolutions :** Nouveau module articlePublisherHelpers pour présentation/aiguillage contenu privé. - **Page affectées :** components/PaymentModal.tsx, lib/articlePublisher.ts, lib/articlePublisherHelpers.ts, lib/paymentPolling.ts, lib/sponsoring.ts, lib/nostrZapVerification.ts et dépendances liées.
31 lines
929 B
TypeScript
31 lines
929 B
TypeScript
import React from 'react'
|
|
import Link from 'next/link'
|
|
import type { Notification } from '@/types/notifications'
|
|
|
|
interface NotificationContentProps {
|
|
notification: Notification
|
|
}
|
|
|
|
export function NotificationContent({ notification }: NotificationContentProps) {
|
|
return (
|
|
<div className="flex-1 min-w-0">
|
|
<div className="flex items-center gap-2 mb-1">
|
|
<p className="text-sm font-medium text-gray-900">{notification.title}</p>
|
|
{!notification.read && (
|
|
<span className="w-2 h-2 bg-blue-600 rounded-full flex-shrink-0" />
|
|
)}
|
|
</div>
|
|
<p className="text-sm text-gray-600">{notification.message}</p>
|
|
{notification.articleId && (
|
|
<Link
|
|
href="/"
|
|
onClick={(e) => e.stopPropagation()}
|
|
className="text-xs text-blue-600 hover:text-blue-700 mt-1 inline-block"
|
|
>
|
|
View article →
|
|
</Link>
|
|
)}
|
|
</div>
|
|
)
|
|
}
|