/** * Renders the card that shows a playlist in profiles, search results and the * dump page's "In collections" section. * * @module */ import { Link, useNavigate } from "react-router"; import { t } from "@lingui/core/macro"; import { Plural, Trans } from "@lingui/react/macro"; import type { Playlist } from "../../../shared/playlist.ts"; import { relativeTime } from "../../utils/shared/relativeTime.ts"; import { playlistImageUrl, playlistUrl } from "../../utils/shared/urls.ts"; import { useAuth } from "../../hooks/auth/useAuth.ts"; import { isPlaylistVisited, isRecent, markPlaylistVisited, } from "../../utils/shared/visited.ts"; import { Tooltip } from "../shared/Tooltip.tsx"; /** Passed to {@link PlaylistCard} by each list of playlists. */ export interface PlaylistCardProps { playlist: Playlist; /** * Shows a delete button, which calls it. The owner's playlists pages pass * one that asks for confirmation first. */ onDelete?: () => void; /** Hides the owner link and the unread dot. */ isOwner?: boolean; } /** * Renders a playlist as a card that opens the playlist when clicked. Another * user's recent playlist shows an unread dot until it is opened on this * device. The card is an `
{playlist.description}
)}