diff options
Diffstat (limited to 'apps/web/components/dashboard/admin/AdminActions.tsx')
| -rw-r--r-- | apps/web/components/dashboard/admin/AdminActions.tsx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/apps/web/components/dashboard/admin/AdminActions.tsx b/apps/web/components/dashboard/admin/AdminActions.tsx index dfdf65eb..e5d6ed69 100644 --- a/apps/web/components/dashboard/admin/AdminActions.tsx +++ b/apps/web/components/dashboard/admin/AdminActions.tsx @@ -52,6 +52,21 @@ export default function AdminActions() { }, }); + const { mutateAsync: tidyAssets, isPending: isTidyAssetsPending } = + api.admin.tidyAssets.useMutation({ + onSuccess: () => { + toast({ + description: "Tidy assets request has been enqueued!", + }); + }, + onError: (e) => { + toast({ + variant: "destructive", + description: e.message, + }); + }, + }); + return ( <div> <div className="mb-2 mt-8 text-xl font-medium">Actions</div> @@ -97,6 +112,13 @@ export default function AdminActions() { > Reindex All Bookmarks </ActionButton> + <ActionButton + variant="destructive" + loading={isTidyAssetsPending} + onClick={() => tidyAssets()} + > + Compact Assets + </ActionButton> </div> </div> ); |
