import * as WebBrowser from 'expo-web-browser'; import useSWR from 'swr'; import { SERVICE_LABELS, SPOTIFY_LINK_PAGES, isQuietScrobbler, type ConnectionDTO } from '@musicshare/shared'; import { Body, Button, Card } from './ui'; /** Nudge when Last.fm/ListenBrainz has gone quiet: usually Spotify's 6-month link expired. */ export function RelinkReminder() { const { data: connections = [] } = useSWR('/connections'); const quiet = connections.find((c) => isQuietScrobbler(c)); if (!quiet || !isQuietScrobbler(quiet)) return null; const name = SERVICE_LABELS[quiet.provider]; return ( Nothing new from {name} in over a week. If you listen on Spotify, its link to {name} expires every 6 months. Re-link it to keep sharing.