This repository has been archived on 2024-10-29. You can view files and clone it, but cannot push or open issues or pull requests.
website/components/Application/Members/Members.tsx

37 lines
1.0 KiB
TypeScript
Raw Normal View History

import useTranslation from 'next-translate/useTranslation'
import InfiniteScroll from 'react-infinite-scroll-component'
import { Divider } from '../../design/Divider'
import { Loader } from 'components/design/Loader'
import { useMembers } from 'contexts/Members'
import { Member } from './Member'
import { capitalize } from '../../../tools/utils/capitalize'
export const Members: React.FC = () => {
const { members, hasMore, nextPage } = useMembers()
const { t } = useTranslation()
return (
<>
<div className='mb-2'>
<h1 data-cy='members-title' className='text-center pt-2 my-2 text-xl'>
{capitalize(t('application:members'))}
</h1>
<Divider />
</div>
<InfiniteScroll
className='members-list'
dataLength={members.length}
next={nextPage}
hasMore={hasMore}
loader={<Loader />}
>
{members.map((member) => {
return <Member key={member.id} member={member} />
})}
</InfiniteScroll>
</>
)
}