import { Blog } from '@/payload-types'
import { Slide } from '@/compositions/ImageCardSlider/ImageCardSlider'

export const blogToSlides = (blog: Blog[]): Slide[] => {
  return blog.map(b => {
    return {
      id: b.id,
      title: b.title,
      href: `/blog/${b.id}`,
      src: typeof b.photo === "string" ? b.photo : b.photo?.url || ""
    }
  })
}