mirror of
https://github.com/Unleash/unleash.git
synced 2025-09-24 17:51:14 +02:00
* fix: restore previous invoices page * fix: show previous invoices page if UNLEASH_CLOUD is falsy * fix: use correct amountFormatted invoice field name
26 lines
838 B
TypeScript
26 lines
838 B
TypeScript
import { useContext } from 'react';
|
|
import InvoiceList from './InvoiceList';
|
|
import AccessContext from 'contexts/AccessContext';
|
|
import { ADMIN } from 'component/providers/AccessProvider/permissions';
|
|
import { ConditionallyRender } from 'component/common/ConditionallyRender/ConditionallyRender';
|
|
import { Alert } from '@mui/material';
|
|
|
|
const InvoiceAdminPage = () => {
|
|
const { hasAccess } = useContext(AccessContext);
|
|
return (
|
|
<div>
|
|
<ConditionallyRender
|
|
condition={hasAccess(ADMIN)}
|
|
show={<InvoiceList />}
|
|
elseShow={
|
|
<Alert severity="error">
|
|
You need to be instance admin to access this section.
|
|
</Alert>
|
|
}
|
|
/>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default InvoiceAdminPage;
|