diff options
| author | 2024-05-01 15:11:22 +0200 | |
|---|---|---|
| committer | 2024-05-01 14:11:22 +0100 | |
| commit | 725a21b02721f92ed0420ed3f807ee921de77992 (patch) | |
| tree | 3940e4b0a7cf3328357ccb86be971126ab2a12b5 /web/source/settings/views/moderation/accounts/pending | |
| parent | [bugfix] Tidy up remaining references to workers in cmd (#2889) (diff) | |
| download | gotosocial-725a21b02721f92ed0420ed3f807ee921de77992.tar.xz | |
[feature] Page through accounts as moderator (#2881)
* [feature] Page through accounts as moderator
* aaaaa
* use COLLATE "C" for Postgres to ensure same ordering as SQLite
* fix typo, test paging up
* don't show moderation / info for our instance acct
Diffstat (limited to 'web/source/settings/views/moderation/accounts/pending')
| -rw-r--r-- | web/source/settings/views/moderation/accounts/pending/index.tsx | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/web/source/settings/views/moderation/accounts/pending/index.tsx b/web/source/settings/views/moderation/accounts/pending/index.tsx index d5a32f09b..b72de52bf 100644 --- a/web/source/settings/views/moderation/accounts/pending/index.tsx +++ b/web/source/settings/views/moderation/accounts/pending/index.tsx @@ -17,20 +17,40 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -import React from "react"; +import React, { ReactNode } from "react"; import { useSearchAccountsQuery } from "../../../../lib/query/admin"; -import { AccountList } from "../../../../components/account-list"; +import { PageableList } from "../../../../components/pageable-list"; +import { useLocation } from "wouter"; +import Username from "../../../../components/username"; +import { AdminAccount } from "../../../../lib/types/account"; export default function AccountsPending() { + const [ location, _setLocation ] = useLocation(); const searchRes = useSearchAccountsQuery({status: "pending"}); + // Function to map an item to a list entry. + function itemToEntry(account: AdminAccount): ReactNode { + const acc = account.account; + return ( + <Username + key={acc.acct} + account={account} + linkTo={`/${account.id}`} + backLocation={location} + classNames={["entry"]} + /> + ); + } + return ( <div className="accounts-view"> <h1>Pending Accounts</h1> - <AccountList + <PageableList isLoading={searchRes.isLoading} + isFetching={searchRes.isFetching} isSuccess={searchRes.isSuccess} - data={searchRes.data} + items={searchRes.data?.accounts} + itemToEntry={itemToEntry} isError={searchRes.isError} error={searchRes.error} emptyMessage="No pending account sign-ups." |
