pleroma/app/soapbox/features/admin/components/admin-tabs.tsx

31 lines
695 B
TypeScript
Raw Normal View History

2022-04-28 13:04:49 -07:00
import React from 'react';
import { useHistory } from 'react-router-dom';
import { Tabs } from 'soapbox/components/ui';
interface IAdminTabs {
activeItem: 'dashboard' | 'reports' | 'approval',
}
const AdminTabs: React.FC<IAdminTabs> = ({ activeItem }) => {
const history = useHistory();
const tabs = [{
name: 'dashboard',
text: 'Dashboard',
action: () => history.push('/admin'),
}, {
name: 'reports',
text: 'Reports',
action: () => history.push('/admin/reports'),
}, {
name: 'approval',
text: 'Waitlist',
action: () => history.push('/admin/approval'),
}];
return <Tabs items={tabs} activeItem={activeItem} />;
};
export default AdminTabs;