Update resources/scripts/components/dashboard/DashboardContainer.tsx
This commit is contained in:
parent
da67cd4206
commit
37ec560c98
1 changed files with 7 additions and 6 deletions
|
@ -13,11 +13,14 @@ import useSWR from 'swr';
|
|||
import { PaginatedResult } from '@/api/http';
|
||||
import Pagination from '@/components/elements/Pagination';
|
||||
import { useLocation } from 'react-router-dom';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
import BeforeContent from '@/blueprint/components/Dashboard/BeforeContent';
|
||||
import AfterContent from '@/blueprint/components/Dashboard/AfterContent';
|
||||
|
||||
export default () => {
|
||||
const { t } = useTranslation('dashboard/index');
|
||||
|
||||
const { search } = useLocation();
|
||||
const defaultPage = Number(new URLSearchParams(search).get('page') || '1');
|
||||
|
||||
|
@ -52,12 +55,12 @@ export default () => {
|
|||
}, [error]);
|
||||
|
||||
return (
|
||||
<PageContentBlock title={'Dashboard'} showFlashKey={'dashboard'}>
|
||||
<PageContentBlock title={t('title')} showFlashKey={'dashboard'}>
|
||||
<BeforeContent />
|
||||
{rootAdmin && (
|
||||
<div css={tw`mb-2 flex justify-end items-center`}>
|
||||
<p css={tw`uppercase text-xs text-neutral-400 mr-2`}>
|
||||
{showOnlyAdmin ? "Showing others' servers" : 'Showing your servers'}
|
||||
{showOnlyAdmin ? t('showing-others-servers') : t('showing-your-servers')}
|
||||
</p>
|
||||
<Switch
|
||||
name={'show_all_servers'}
|
||||
|
@ -77,9 +80,7 @@ export default () => {
|
|||
))
|
||||
) : (
|
||||
<p css={tw`text-center text-sm text-neutral-400`}>
|
||||
{showOnlyAdmin
|
||||
? 'There are no other servers to display.'
|
||||
: 'There are no servers associated with your account.'}
|
||||
{showOnlyAdmin ? t('no-other-servers') : t('no-servers-associated')}
|
||||
</p>
|
||||
)
|
||||
}
|
||||
|
@ -88,4 +89,4 @@ export default () => {
|
|||
<AfterContent />
|
||||
</PageContentBlock>
|
||||
);
|
||||
};
|
||||
};
|
Loading…
Reference in a new issue