
import { useTranslation } from 'react-i18next'
import { Event } from 'nostr-tools'

export default function MusicTrackPreview({ event }: { event: Event }) {
  const { t } = useTranslation()

  const title = event.tags.find(tag => tag[0] === 'title')?.[1]
  const artist = event.tags.find(tag => tag[0] === 'artist')?.[1]

  return (
    <div className="flex items-center gap-2 truncate">
    <span>🎵</span>
    <span className="font-medium truncate">
    {title || t('music.untitled')}
    </span>
    {artist && (
      <span className="text-muted-foreground truncate">
      {t('music.by')} {artist}
      </span>
    )}
    </div>
  )
}
