diff --git a/src/components/social/Notifications.tsx b/src/components/social/Notifications.tsx index 9d287bb..ae37170 100644 --- a/src/components/social/Notifications.tsx +++ b/src/components/social/Notifications.tsx @@ -1,4 +1,4 @@ -import { Loader2 } from 'lucide-react' +import { Loader2, Tv } from 'lucide-react' import { useEffect, useState } from 'react' import { t } from '../../i18n' import { listNotifications, markNotificationsRead, type AppNotification, type NotificationKind } from '../../lib/cloud/notifications' @@ -9,16 +9,19 @@ import Sheet from './Sheet' const PAGE = 30 const FOLLOW_KINDS: NotificationKind[] = ['follow_request', 'follow_accepted', 'new_follower'] +const EPISODE_KINDS: NotificationKind[] = ['new_episode', 'new_season'] const VERB: Record string> = { follow_request: () => t('notif.follow_request'), follow_accepted: () => t('notif.follow_accepted'), new_follower: () => t('notif.new_follower'), reaction: () => t('notif.reaction'), + new_episode: () => '', + new_season: () => '', } -/** Liste des notifications (abonnements, demandes acceptées, réactions). Marque comme lues à l'ouverture. */ -export default function Notifications({ onClose, onOpenProfile }: { onClose: () => void; onOpenProfile: (username: string) => void }) { +/** Liste des notifications (abonnements, réactions, nouveaux épisodes). Marque comme lues à l'ouverture. */ +export default function Notifications({ onClose, onOpenProfile, onOpenItem }: { onClose: () => void; onOpenProfile: (username: string) => void; onOpenItem: (itemId: string) => void }) { const [items, setItems] = useState(undefined) const [done, setDone] = useState(false) const [loadingMore, setLoadingMore] = useState(false) @@ -37,7 +40,6 @@ export default function Notifications({ onClose, onOpenProfile }: { onClose: () setDone(true) } } - // Marque comme lu (feu et oubli) pour vider le badge markNotificationsRead().catch(() => {}) })() return () => { @@ -72,7 +74,7 @@ export default function Notifications({ onClose, onOpenProfile }: { onClose: () ) : (