'use client'

import SearchBooks from '@/components/Search/SearchBooks'
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 (
    <section>
      <SearchBooks initBrowseBooks={initialBooks} />
    </section>
  )
}

export default BooksPageClient
