Update resources/scripts/components/dashboard/DashboardContainer.tsx

This commit is contained in:
denis 2024-11-03 02:34:32 -05:00
parent da67cd4206
commit 37ec560c98

View file

@ -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>
)
}