pl-fe: improve empty column messages

Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
nicole mikołajczyk
2025-10-13 14:33:27 +02:00
parent 7e17ec3ac0
commit 8cfda4b38d
58 changed files with 119 additions and 128 deletions

View File

@ -1,18 +1,12 @@
import React, { useEffect, useState } from 'react';
import { defineMessages, useIntl } from 'react-intl';
import { FormattedMessage } from 'react-intl';
import ScrollableList from 'pl-fe/components/scrollable-list';
import { useAdminAccounts } from 'pl-fe/queries/admin/use-accounts';
import UnapprovedAccount from '../components/unapproved-account';
const messages = defineMessages({
heading: { id: 'column.admin.awaiting_approval', defaultMessage: 'Awaiting Approval' },
emptyMessage: { id: 'admin.awaiting_approval.empty_message', defaultMessage: 'There is nobody waiting for approval. When a new user signs up, you can review them here.' },
});
const AwaitingApproval: React.FC = () => {
const intl = useIntl();
const { data, isPending, isFetching } = useAdminAccounts({
origin: 'local',
status: 'pending',
@ -29,7 +23,7 @@ const AwaitingApproval: React.FC = () => {
scrollKey='awaitingApproval'
isLoading={isFetching}
showLoading={isPending}
emptyMessage={intl.formatMessage(messages.emptyMessage)}
emptyMessageText={<FormattedMessage id='admin.awaiting_approval.empty_message' defaultMessage='There is nobody waiting for approval. When a new user signs up, you can review them here.' />}
listClassName='divide-y divide-solid divide-gray-200 dark:divide-gray-800'
>
{accountIds.map(id => (

View File

@ -1,5 +1,5 @@
import React from 'react';
import { defineMessages, FormattedList, FormattedMessage, useIntl } from 'react-intl';
import { FormattedList, FormattedMessage } from 'react-intl';
import { useSearchParams } from 'react-router-dom-v5-compat';
import { useAccount } from 'pl-fe/api/hooks/accounts/use-account';
@ -11,14 +11,7 @@ import { useReports } from 'pl-fe/queries/admin/use-reports';
import Report from '../components/report';
const messages = defineMessages({
heading: { id: 'column.admin.reports', defaultMessage: 'Reports' },
modlog: { id: 'column.admin.reports.menu.moderation_log', defaultMessage: 'Moderation log' },
emptyMessage: { id: 'admin.reports.empty_message', defaultMessage: 'There are no open reports. If a user gets reported, they will show up here.' },
});
const Reports: React.FC = () => {
const intl = useIntl();
const [params, setParams] = useSearchParams();
const resolved = params.get('resolved') as any as boolean || undefined;
@ -70,7 +63,7 @@ const Reports: React.FC = () => {
scrollKey='adminReports'
isLoading={isPending}
showLoading={isPending}
emptyMessage={intl.formatMessage(messages.emptyMessage)}
emptyMessageText={<FormattedMessage id='admin.reports.empty_message' defaultMessage='There are no open reports. If a user gets reported, they will show up here.' />}
hasMore={hasNextPage}
onLoadMore={fetchNextPage}
itemClassName='pt-4'