2023-03-08 10:22:10 -08:00
|
|
|
import React from 'react';
|
|
|
|
|
2023-06-28 11:50:46 -07:00
|
|
|
import { usePendingGroups } from 'soapbox/api/hooks';
|
2023-03-20 14:09:19 -07:00
|
|
|
import { PendingItemsRow } from 'soapbox/components/pending-items-row';
|
|
|
|
import { Divider } from 'soapbox/components/ui';
|
2023-03-08 10:22:10 -08:00
|
|
|
import { useFeatures } from 'soapbox/hooks';
|
|
|
|
|
|
|
|
export default () => {
|
|
|
|
const features = useFeatures();
|
|
|
|
|
|
|
|
const { groups, isFetching } = usePendingGroups();
|
|
|
|
|
|
|
|
if (!features.groupsPending || isFetching || groups.length === 0) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
2023-03-20 14:09:19 -07:00
|
|
|
<PendingItemsRow
|
|
|
|
to='/groups/pending-requests'
|
|
|
|
count={groups.length}
|
2023-03-20 14:26:40 -07:00
|
|
|
size='lg'
|
2023-03-20 14:09:19 -07:00
|
|
|
/>
|
2023-03-08 10:22:10 -08:00
|
|
|
|
|
|
|
<Divider />
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|