diff --git a/src/index.ts b/src/index.ts index 3b03e47..d1a1627 100644 --- a/src/index.ts +++ b/src/index.ts @@ -34,6 +34,11 @@ export type PayloadFeatureFlagsConfig = { * Override collection configuration */ collectionOverrides?: CollectionOverrides + /** + * Enable custom list view for feature flags + * @default false + */ + enableCustomListView?: boolean } export const payloadFeatureFlags = @@ -44,6 +49,7 @@ export const payloadFeatureFlags = defaultValue = false, enableRollouts = true, enableVariants = true, + enableCustomListView = false, collectionOverrides, } = pluginOptions @@ -163,6 +169,14 @@ export const payloadFeatureFlags = useAsTitle: 'name', group: 'Configuration', description: 'Manage feature flags for your application', + components: enableCustomListView ? { + ...collectionOverrides?.admin?.components, + views: { + list: { + Component: '@xtr-dev/payload-feature-flags/views#FeatureFlagsView' + } + } + } : (collectionOverrides?.admin?.components || {}), ...(collectionOverrides?.admin || {}), }, fields,