import useTranslation from 'next-translate/useTranslation' import { useEffect, useState } from 'react' import InfiniteScroll from 'react-infinite-scroll-component' import { useAuthentication } from '../../../tools/authentication' import { GuildPublic as GuildPublicType } from '../../../models/Guild' import { Loader } from '../../design/Loader' import { GuildPublic } from './GuildPublic' import { usePagination } from '../../../hooks/usePagination' export const JoinGuildsPublic: React.FC = () => { const [search, setSearch] = useState('') const { authentication } = useAuthentication() const { t } = useTranslation() const { items, hasMore, nextPage, resetPagination } = usePagination({ api: authentication.api, url: '/guilds/public' }) useEffect(() => { resetPagination() nextPage({ search }) }, [resetPagination, nextPage, search]) const handleChange = (event: React.ChangeEvent): void => { setSearch(event.target.value) } return ( <>
} > {items.map((guild) => { return })}
) }