Component Documentation - README¶
Status: Phase 3 In Progress
Tier 1: ✅ Complete (15/15)
Tier 2: 🔄 In Progress
Tier 3: ⏳ Pending
Overview¶
Comprehensive documentation of all 76 reusable components in the machineagents-fe frontend application, organized by complexity tier.
Documentation Structure¶
Tier 1: Deep Dive (15 components) - ✅ COMPLETE¶
Files:
- top-level.md - Top 3 utility components (207 lines total)
- home-sections.md - 16 homepage sections (~1,000 lines total)
Coverage: Exhaustive code-level analysis with:
- Complete state variable documentation
- Full API integration details
- Code snippets and examples
- Error handling patterns
- Architectural insights
- Issues and limitations identified
Components:
- AboutUsVideo (133 lines) - Video player
- DynamicPageRenderer (38 lines) - CMS mapper
- GlobalVideoController (36 lines) - Init component
- LanguageSelectorSection (432 lines) - LARGEST
- OurAiAgents (329 lines) - Multi-video grid
- PlugAndPlaySection (324 lines) - Platform logos
- UseCases (287 lines) - Video carousel
- PricingSection (296 lines) - Dynamic pricing
- HeroSection (144 lines) - Homepage hero
- VideoDemoSection - Video showcase
- TryFreeAgentSection - Free trial CTA
- ProtectedLayout (49 lines) - Auth guard
- HomePageClient (69 lines) - Homepage wrapper 14-15. Referenced wizard components
Tier 2: Standard (30 components) - 🔄 IN PROGRESS¶
Files:
- chatbot-wizard.md - Wizard step components
- modals.md - Modal dialogs
Coverage: Standard documentation with:
- Props interfaces
- Key features
- Usage examples
- Integration points
- Basic state management
Tier 3: Quick Reference (31 components) - ⏳ PENDING¶
Files:
Coverage: Quick reference with:
- Purpose
- Props
- Usage example
Component Categories¶
By Location¶
src/components/ (3 files)
- Top-level utility components
src/components/home/ (16 files)
- Homepage section components
src/app/components/ (57 files)
- Application-level components
By Function¶
Video Management (5):
- AboutUsVideo, GlobalVideoController
- LanguageSelectorSection, OurAiAgents, UseCases
CMS Integration (2):
- DynamicPageRenderer, HomePageClient
Authentication (1):
- ProtectedLayout
Chatbot Wizards (7):
- Profile, Purpose, QA, Text, UTM, Voice, Video, Avatar, FileUpload
Modals (7):
- Popup, Billing, Knowledge, Premium, Share, UserProfile, WebsitePreview
Navigation (6):
- HomeNavbar, Navbar, Sidebar, BackButton, BillingSidebar, NavigationWrapper
Forms (4):
- ContactForm, ContactForm2, Login, FormSetup
UI Elements (4):
- FeatureCard, KeyFeatures, MachineCard, Loader
Home Sections (16):
- Hero, VideoDemo, OurAiAgents, PlugAndPlay, HowItWorks, Language, Vision, UseCases, etc.
Key Patterns Identified¶
1. Video Coordination (3-Layer System)¶
Layer 1: mobileVideoManager - Single video on mobile
Layer 2: globalVideoManager - App-wide coordination
Layer 3: Custom events - Cross-component communication
Components: AboutUsVideo, LanguageSelectorSection, OurAiAgents, UseCases
2. Strapi CMS Integration¶
DynamicPageRenderer: Maps Strapi components to React components
Component Map: 8 homepage sections registered
Usage: Dynamic section rendering from CMS
3. Authentication Patterns¶
ProtectedLayout: Session storage + shared link support
Redirect Logic: Auto-redirect to /login on auth failure
Loading States: Spinner during auth check
4. Code Health Issues¶
Dead Code: 282 lines commented (PlugAndPlaySection - 87%)
Unused Props: HeroSection, PlugAndPlaySection ignore CMS props
Hardcoded Values: Multiple components bypass prop system
Progress Tracking¶
Total Components: 76
Tier 1 Complete: 15 (20%)
Tier 2 In Progress: 0/30 (0%)
Tier 3 Pending: 0/31 (0%)
Overall: 20% Complete
Navigation¶
Last Updated: Phase 3 Tier 1 Complete (December 29, 2024)
Next: Tier 2 Standard Documentation