import React, { useState, useMemo } from 'react'; export const RotationsBrowser = () => { const [searchTerm, setSearchTerm] = useState(''); const [selectedCategory, setSelectedCategory] = useState('All'); const categories = ['All', 'Databases', 'Identity & Auth', 'Cloud Providers']; const rotations = [ {"name": "AWS IAM User", "slug": "aws-iam-user", "path": "/documentation/platform/secret-rotation/aws-iam-user-secret", "description": "Learn how to automatically rotate AWS IAM user access keys.", "category": "Cloud Providers"}, {"name": "Azure Client Secret", "slug": "azure-client-secret", "path": "/documentation/platform/secret-rotation/azure-client-secret", "description": "Learn how to automatically rotate Azure client secrets.", "category": "Cloud Providers"}, {"name": "Auth0 Client Secret", "slug": "auth0-client-secret", "path": "/documentation/platform/secret-rotation/auth0-client-secret", "description": "Learn how to automatically rotate Auth0 client secrets.", "category": "Identity & Auth"}, {"name": "Okta Client Secret", "slug": "okta-client-secret", "path": "/documentation/platform/secret-rotation/okta-client-secret", "description": "Learn how to automatically rotate Okta client secrets.", "category": "Identity & Auth"}, {"name": "LDAP Password", "slug": "ldap-password", "path": "/documentation/platform/secret-rotation/ldap-password", "description": "Learn how to automatically rotate LDAP user passwords.", "category": "Identity & Auth"}, {"name": "MySQL", "slug": "mysql-credentials", "path": "/documentation/platform/secret-rotation/mysql-credentials", "description": "Learn how to automatically rotate MySQL database credentials.", "category": "Databases"}, {"name": "PostgreSQL", "slug": "postgres-credentials", "path": "/documentation/platform/secret-rotation/postgres-credentials", "description": "Learn how to automatically rotate PostgreSQL database credentials.", "category": "Databases"}, {"name": "Redis", "slug": "redis-credentials", "path": "/documentation/platform/secret-rotation/redis-credentials", "description": "Learn how to automatically rotate Redis database credentials.", "category": "Databases"}, {"name": "Microsoft SQL Server", "slug": "mssql-credentials", "path": "/documentation/platform/secret-rotation/mssql-credentials", "description": "Learn how to automatically rotate Microsoft SQL Server credentials.", "category": "Databases"}, {"name": "Oracle Database", "slug": "oracledb-credentials", "path": "/documentation/platform/secret-rotation/oracledb-credentials", "description": "Learn how to automatically rotate Oracle Database credentials.", "category": "Databases"} ].sort(function(a, b) { return a.name.toLowerCase().localeCompare(b.name.toLowerCase()); }); const filteredRotations = useMemo(() => { let filtered = rotations; if (selectedCategory !== 'All') { filtered = filtered.filter(rotation => rotation.category === selectedCategory); } if (searchTerm) { filtered = filtered.filter(rotation => rotation.name.toLowerCase().includes(searchTerm.toLowerCase()) || rotation.description.toLowerCase().includes(searchTerm.toLowerCase()) || rotation.category.toLowerCase().includes(searchTerm.toLowerCase()) ); } return filtered; }, [searchTerm, selectedCategory]); return (
{/* Search Bar */}
setSearchTerm(e.target.value)} />
{/* Category Filter */}
{categories.map(category => ( ))}
{/* Results Count */}

{filteredRotations.length} secret rotation{filteredRotations.length !== 1 ? 's' : ''} found {selectedCategory !== 'All' && ` in ${selectedCategory}`} {searchTerm && ` for "${searchTerm}"`}

{/* Rotations List */} {filteredRotations.length > 0 ? (
{filteredRotations.map((rotation, index) => (

{rotation.name}

{rotation.category}

{rotation.description}

))}
) : (

No secret rotations found matching your criteria

{searchTerm && (

Try adjusting your search terms or filters

)}
)}
); };