audit.tsx46 lines · main
| 1 | import { LogoLoader } from 'ui' |
| 2 | import { |
| 3 | PageHeader, |
| 4 | PageHeaderDescription, |
| 5 | PageHeaderMeta, |
| 6 | PageHeaderSummary, |
| 7 | PageHeaderTitle, |
| 8 | } from 'ui-patterns/PageHeader' |
| 9 | |
| 10 | import { AuditLogs } from '@/components/interfaces/Organization/AuditLogs/AuditLogs' |
| 11 | import { DefaultLayout } from '@/components/layouts/DefaultLayout' |
| 12 | import OrganizationLayout from '@/components/layouts/OrganizationLayout' |
| 13 | import { OrganizationSettingsLayout } from '@/components/layouts/ProjectLayout/OrganizationSettingsLayout' |
| 14 | import { usePermissionsQuery } from '@/data/permissions/permissions-query' |
| 15 | import { useSelectedOrganizationQuery } from '@/hooks/misc/useSelectedOrganization' |
| 16 | import type { NextPageWithLayout } from '@/types' |
| 17 | |
| 18 | const OrgAuditLogs: NextPageWithLayout = () => { |
| 19 | const { isPending: isLoadingPermissions } = usePermissionsQuery() |
| 20 | const { data: selectedOrganization } = useSelectedOrganizationQuery() |
| 21 | |
| 22 | return ( |
| 23 | <> |
| 24 | <PageHeader size="default"> |
| 25 | <PageHeaderMeta> |
| 26 | <PageHeaderSummary> |
| 27 | <PageHeaderTitle>Audit Logs</PageHeaderTitle> |
| 28 | <PageHeaderDescription> |
| 29 | Organization-level activity history and security event records |
| 30 | </PageHeaderDescription> |
| 31 | </PageHeaderSummary> |
| 32 | </PageHeaderMeta> |
| 33 | </PageHeader> |
| 34 | {selectedOrganization === undefined && isLoadingPermissions ? <LogoLoader /> : <AuditLogs />} |
| 35 | </> |
| 36 | ) |
| 37 | } |
| 38 | |
| 39 | OrgAuditLogs.getLayout = (page) => ( |
| 40 | <DefaultLayout> |
| 41 | <OrganizationLayout title="Audit Logs"> |
| 42 | <OrganizationSettingsLayout>{page}</OrganizationSettingsLayout> |
| 43 | </OrganizationLayout> |
| 44 | </DefaultLayout> |
| 45 | ) |
| 46 | export default OrgAuditLogs |