'use client'

import BookList from '@/components/BookList'
import { Book } from '@/payload-types'
import { PaginatedDocs } from 'payload'
import { useMemo } from 'react'

type Props = {
  initialBooks: PaginatedDocs<Book>
}
const BooksPageClient = (props: Props) => {
  const initialBooks = useMemo(() => {
    return props.initialBooks
  }, [props.initialBooks])

  return (
    <div>
      <BookList books={initialBooks} />
    </div>
  )
}

export default BooksPageClient
