also change some var names and headings to reflect when data is in borrower role and when data is in lender
33 lines
752 B
TypeScript
33 lines
752 B
TypeScript
'use client'
|
|
|
|
import { Checkout, Repository, User } from '@/payload-types'
|
|
import { PaginatedDocs } from 'payload'
|
|
import RepoList from './RepoList'
|
|
import HoldRequestNotifications from './HoldRequests'
|
|
import BorrowedBooks from './BorrowedBooks'
|
|
|
|
type Props = {
|
|
repos: PaginatedDocs<Repository> | null
|
|
borrows: PaginatedDocs<Checkout> | null
|
|
user: User | null
|
|
}
|
|
const Manage = (props: Props) => {
|
|
const { repos, borrows, user } = props
|
|
|
|
return (
|
|
<section>
|
|
<div className="my-6">
|
|
<RepoList repos={repos} />
|
|
</div>
|
|
|
|
<div>{user && <HoldRequestNotifications repos={repos} user={user} />}</div>
|
|
|
|
<div>
|
|
<BorrowedBooks initialBorrows={borrows} />
|
|
</div>
|
|
</section>
|
|
)
|
|
}
|
|
|
|
export default Manage
|