export interface Track {
  id: string
  title: string
  artist: string
  album?: string
  image: string
  duration: number // in seconds
  audioUrl?: string
}

export interface Playlist {
  id: string
  title: string
  description?: string
  image: string
  tracks: Track[]
  createdBy: string
  isLiked?: boolean
}

export interface Artist {
  id: string
  name: string
  image: string
  followers: number
  isFollowing?: boolean
}

export interface Album {
  id: string
  title: string
  artist: string
  image: string
  year: number
  tracks: Track[]
}

// Components should fetch data from API instead
export const allTracks: Track[] = []
export const allArtists: Artist[] = []
export const allAlbums: Album[] = []

// Helper function to format duration
export function formatDuration(seconds: number): string {
  const mins = Math.floor(seconds / 60)
  const secs = seconds % 60
  return `${mins}:${secs.toString().padStart(2, "0")}`
}

// Helper function to format duration from milliseconds
export function formatDurationMs(milliseconds: number): string {
  return formatDuration(Math.floor(milliseconds / 1000))
}

// These functions now return undefined - data should come from database
export function getTrackById(id: string): Track | undefined {
  return undefined
}

export function getArtistById(id: string): Artist | undefined {
  return undefined
}

export function getAlbumById(id: string): Album | undefined {
  return undefined
}
