import { useEffect } from 'react' import InfiniteScroll from 'react-infinite-scroll-component' import { useAuthentication } from 'utils/authentication' import { GuildWithDefaultChannelId } from 'models/Guild' import { Loader } from 'components/design/Loader' import { ApplicationProps } from '../Application' import { Guild } from './Guild' import { usePagination } from 'hooks/usePagination' export interface GuildsProps extends ApplicationProps {} export const Guilds: React.FC = (props) => { const { path } = props const { authentication } = useAuthentication() const { items, hasMore, nextPage } = usePagination( { api: authentication.api, url: '/guilds' } ) useEffect(() => { nextPage() }, [nextPage]) return (
} > {items.map((guild) => { return ( ) })}
) }