tachybase_todo/packages/plugins/audit-logs/src/client/AuditLogsBlockProvider.tsx

31 lines
1.3 KiB
TypeScript
Raw Normal View History

import {
CollectionManagerProvider,
SchemaInitializerProvider,
TableBlockProvider
} from '@nocobase/client';
import React from 'react';
import { useAuditChangesCollection, useAuditLogsCollection, useCollectionsCollection } from './collections';
import { AuditLogsTableActionColumnInitializers } from './initializers/AuditLogsTableActionColumnInitializers';
import { AuditLogsTableActionInitializers } from './initializers/AuditLogsTableActionInitializers';
import { AuditLogsTableColumnInitializers } from './initializers/AuditLogsTableColumnInitializers';
export const AuditLogsBlockProvider: React.FC = ({ children, ...restProps }) => {
const auditChangesCollection = useAuditChangesCollection();
const auditLogsCollection = useAuditLogsCollection();
const collectionsCollection = useCollectionsCollection();
return (
<SchemaInitializerProvider
initializers={{
AuditLogsTableActionInitializers,
AuditLogsTableActionColumnInitializers,
AuditLogsTableColumnInitializers,
}}
>
<CollectionManagerProvider collections={[auditLogsCollection, auditChangesCollection, collectionsCollection]}>
<TableBlockProvider {...restProps}>{children}</TableBlockProvider>
</CollectionManagerProvider>
</SchemaInitializerProvider>
);
};