diff --git a/src/frontend/src/pages/Index/Settings/AdminCenter/generateQuickAction.tsx b/src/frontend/src/components/settings/QuickAction.tsx similarity index 53% rename from src/frontend/src/pages/Index/Settings/AdminCenter/generateQuickAction.tsx rename to src/frontend/src/components/settings/QuickAction.tsx index 1bad8c4b86..5a07454919 100644 --- a/src/frontend/src/pages/Index/Settings/AdminCenter/generateQuickAction.tsx +++ b/src/frontend/src/components/settings/QuickAction.tsx @@ -10,26 +10,36 @@ import { } from '@mantine/core'; import { IconHome } from '@tabler/icons-react'; -import { ActionButton } from '../../../../components/buttons/ActionButton'; -import { PlaceholderPill } from '../../../../components/items/Placeholder'; +import { ActionButton } from '../buttons/ActionButton'; +import { PlaceholderPill } from '../items/Placeholder'; -export function generateQuickAction(navigate: any) { - return () => ( - +export const QuickAction = ({ + navigate, + ml = 'sm' +}: { + navigate?: any; + ml?: string; +}) => { + return ( + <Trans>Quick Actions</Trans> - } - color="blue" - size="lg" - radius="sm" - variant="filled" - tooltip={t`Go to Home`} - onClick={() => navigate('home')} - /> - + {navigate ? ( + <> + } + color="blue" + size="lg" + radius="sm" + variant="filled" + tooltip={t`Go to Home`} + onClick={() => navigate('home')} + /> + + + ) : null} @@ -48,4 +58,4 @@ export function generateQuickAction(navigate: any) { ); -} +}; diff --git a/src/frontend/src/pages/Index/Settings/AdminCenter/HomePanel.tsx b/src/frontend/src/pages/Index/Settings/AdminCenter/HomePanel.tsx index 75d949d2f4..ac0520f2f2 100644 --- a/src/frontend/src/pages/Index/Settings/AdminCenter/HomePanel.tsx +++ b/src/frontend/src/pages/Index/Settings/AdminCenter/HomePanel.tsx @@ -1,8 +1,10 @@ import { Trans, t } from '@lingui/macro'; -import { Alert, Button, Divider, Stack, Title } from '@mantine/core'; +import { Alert, Button, Stack, Title } from '@mantine/core'; import { IconBrandGithub } from '@tabler/icons-react'; -export default function HomePanel() { +import { QuickAction } from '../../../../components/settings/QuickAction'; + +export default function HomePanel(): JSX.Element { return ( @@ -21,10 +23,7 @@ export default function HomePanel() { Open an issue - - <Trans>Quick actions</Trans> - - TBD + <Trans>System status</Trans> diff --git a/src/frontend/src/pages/Index/Settings/AdminCenter/Index.tsx b/src/frontend/src/pages/Index/Settings/AdminCenter/Index.tsx index 612a596db6..7f1988744e 100644 --- a/src/frontend/src/pages/Index/Settings/AdminCenter/Index.tsx +++ b/src/frontend/src/pages/Index/Settings/AdminCenter/Index.tsx @@ -23,10 +23,10 @@ import { useLocation, useNavigate } from 'react-router-dom'; import PermissionDenied from '../../../../components/errors/PermissionDenied'; import { PanelGroup, PanelType } from '../../../../components/nav/PanelGroup'; import { SettingsHeader } from '../../../../components/nav/SettingsHeader'; +import { QuickAction } from '../../../../components/settings/QuickAction'; import { GlobalSettingList } from '../../../../components/settings/SettingList'; import { Loadable } from '../../../../functions/loading'; import { useUserState } from '../../../../states/UserState'; -import { generateQuickAction } from './generateQuickAction'; const ReportTemplatePanel = Loadable( lazy(() => import('./ReportTemplatePanel')) @@ -96,7 +96,6 @@ export default function AdminCenter() { return panel !== 'home'; }, [panel]); - const QuickAction = generateQuickAction(navigate); const adminCenterPanels: PanelType[] = useMemo(() => { return [ { @@ -213,7 +212,7 @@ export default function AdminCenter() { switch_link="/settings/system" switch_text="System Settings" /> - {showQuickAction ? : null} + {showQuickAction ? : null}