diff --git a/src/views/FeatureFlagsView.tsx b/src/views/FeatureFlagsView.tsx index 7c2afba..ee592b3 100644 --- a/src/views/FeatureFlagsView.tsx +++ b/src/views/FeatureFlagsView.tsx @@ -4,6 +4,7 @@ import { useConfig, useTheme } from '@payloadcms/ui' +import { DefaultTemplate } from '@payloadcms/next/templates' interface FeatureFlag { id: string @@ -24,11 +25,17 @@ interface FeatureFlag { } interface FeatureFlagsViewProps { - // Props that would typically be passed from the parent view - [key: string]: any + i18n?: any + locale?: any + params?: any + payload?: any + permissions?: any + searchParams?: any + user?: any + visibleEntities?: any } -const FeatureFlagsViewComponent = (props: FeatureFlagsViewProps = {}) => { +const FeatureFlagsViewComponent = (props: FeatureFlagsViewProps) => { const { config } = useConfig() const { theme } = useTheme() const [flags, setFlags] = useState([]) @@ -197,80 +204,72 @@ const FeatureFlagsViewComponent = (props: FeatureFlagsViewProps = {}) => { const styles = getThemeStyles() - if (loading) { - return ( -
-
Loading feature flags...
-
- ) - } - - return ( + const FeatureFlagsContent = () => (
- {/* Content Container */} -
- {/* Header */} -
-

- Feature Flags Dashboard -

-

- Manage all feature flags in a spreadsheet view with inline editing capabilities -

-
- - {/* Success/Error Messages */} - {successMessage && ( -
+

- {successMessage} -

- )} - - {error && ( -
+

- Error: {error} + Manage all feature flags in a spreadsheet view with inline editing capabilities +

+
+ + {loading ? ( +
+
Loading feature flags...
- )} + ) : ( + <> + {/* Success/Error Messages */} + {successMessage && ( +
+ {successMessage} +
+ )} + + {error && ( +
+ Error: {error} +
+ )} {/* Controls */}
{ A/B Tests: {flags.filter(f => f && f.variants && f.variants.length > 0).length}
-
+ + )} ) + + return ( + + + + ) } export const FeatureFlagsView = memo(FeatureFlagsViewComponent)