import {type FunctionComponent} from 'react'
import {getFavoriteContacts} from '@/dal/contacts'
import FavoriteCard from '@/app/(authenticated)/contacts/_favoriteContacts/favoriteCard'

const FavoritesList: FunctionComponent = async () => {
  const favorites = await getFavoriteContacts()

  return (
    <>
      {favorites.map(f => (
        <FavoriteCard key={f.id} {...f} />
      ))}
    </>
  )
}

export default FavoritesList
