owncast/web/components/FollowersCollection.tsx

25 lines
599 B
TypeScript
Raw Normal View History

2022-05-04 00:17:05 +03:00
import { Pagination } from 'antd';
import { Follower } from '../interfaces/follower';
2022-05-04 00:17:05 +03:00
import SingleFollower from './Follower';
interface Props {
2022-05-04 00:17:05 +03:00
total: number;
followers: Follower[];
}
export default function FollowerCollection(props: Props) {
2022-05-04 00:17:05 +03:00
const ITEMS_PER_PAGE = 24;
const { followers, total } = props;
const pages = Math.ceil(total / ITEMS_PER_PAGE);
return (
<div>
{followers.map(follower => (
<SingleFollower key={follower.link} follower={follower} />
))}
<Pagination current={1} pageSize={ITEMS_PER_PAGE} total={pages || 1} />
</div>
);
}