2022-04-28 09:36:45 -07:00
|
|
|
import React from 'react';
|
2022-04-28 13:44:12 -07:00
|
|
|
import { defineMessages, useIntl } from 'react-intl';
|
|
|
|
import { Switch, Route } from 'react-router-dom';
|
2022-04-28 09:36:45 -07:00
|
|
|
|
2022-07-22 10:30:16 -07:00
|
|
|
import { Column } from 'soapbox/components/ui';
|
2022-04-28 13:44:12 -07:00
|
|
|
import { useOwnAccount } from 'soapbox/hooks';
|
2022-04-28 09:36:45 -07:00
|
|
|
|
2022-04-28 13:04:49 -07:00
|
|
|
import AdminTabs from './components/admin-tabs';
|
2022-04-28 13:56:17 -07:00
|
|
|
import Waitlist from './tabs/awaiting-approval';
|
2022-04-28 13:44:12 -07:00
|
|
|
import Dashboard from './tabs/dashboard';
|
2022-04-28 14:02:51 -07:00
|
|
|
import Reports from './tabs/reports';
|
2022-04-28 09:36:45 -07:00
|
|
|
|
|
|
|
const messages = defineMessages({
|
|
|
|
heading: { id: 'column.admin.dashboard', defaultMessage: 'Dashboard' },
|
|
|
|
});
|
|
|
|
|
2022-04-28 13:44:12 -07:00
|
|
|
const Admin: React.FC = () => {
|
2022-04-28 09:36:45 -07:00
|
|
|
const intl = useIntl();
|
2023-06-25 10:35:09 -07:00
|
|
|
const { account } = useOwnAccount();
|
2022-04-28 09:36:45 -07:00
|
|
|
|
|
|
|
if (!account) return null;
|
|
|
|
|
|
|
|
return (
|
2022-04-28 12:06:47 -07:00
|
|
|
<Column label={intl.formatMessage(messages.heading)} withHeader={false}>
|
2022-04-28 13:49:29 -07:00
|
|
|
<AdminTabs />
|
2022-04-28 12:06:47 -07:00
|
|
|
|
2022-04-28 13:44:12 -07:00
|
|
|
<Switch>
|
2022-04-30 09:31:04 -07:00
|
|
|
<Route path='/soapbox/admin' exact component={Dashboard} />
|
|
|
|
<Route path='/soapbox/admin/reports' exact component={Reports} />
|
|
|
|
<Route path='/soapbox/admin/approval' exact component={Waitlist} />
|
2022-04-28 13:44:12 -07:00
|
|
|
</Switch>
|
2022-04-28 09:36:45 -07:00
|
|
|
</Column>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2022-04-28 13:44:12 -07:00
|
|
|
export default Admin;
|