diff --git a/src/components/playlists/PlaylistRow.tsx b/src/components/playlists/PlaylistRow.tsx index ae2279a..ea0511f 100644 --- a/src/components/playlists/PlaylistRow.tsx +++ b/src/components/playlists/PlaylistRow.tsx @@ -4,15 +4,22 @@ import { TableCell, TableRow } from '@/components/ui/table' import type { Playlist } from '@/lib/api/services/playlists' import { formatDateDistanceToNow } from '@/utils/format-date' import { formatDuration } from '@/utils/format-duration' -import { Calendar, Clock, Edit, Music, Play, User } from 'lucide-react' +import { cn } from '@/lib/utils' +import { Calendar, Clock, Edit, Heart, Music, Play, User } from 'lucide-react' interface PlaylistRowProps { playlist: Playlist onEdit: (playlist: Playlist) => void onSetCurrent: (playlist: Playlist) => void + onFavoriteToggle?: (playlistId: number, isFavorited: boolean) => void } -export function PlaylistRow({ playlist, onEdit, onSetCurrent }: PlaylistRowProps) { +export function PlaylistRow({ playlist, onEdit, onSetCurrent, onFavoriteToggle }: PlaylistRowProps) { + const handleFavoriteToggle = () => { + if (onFavoriteToggle) { + onFavoriteToggle(playlist.id, !playlist.is_favorited) + } + } return ( @@ -76,6 +83,24 @@ export function PlaylistRow({ playlist, onEdit, onSetCurrent }: PlaylistRowProps
+ {onFavoriteToggle && ( + + )}