# ThrillWiki Component Patterns Guidelines for building UI components consistent with ThrillWiki's design system. ## Component Hierarchy ``` components/ ├── layout/ # Page structure │ ├── Header.vue │ ├── Footer.vue │ ├── Sidebar.vue │ └── PageContainer.vue ├── ui/ # Base components (shadcn/ui style) │ ├── Button.vue │ ├── Card.vue │ ├── Input.vue │ ├── Badge.vue │ ├── Avatar.vue │ ├── Modal.vue │ └── ... ├── entity/ # Domain-specific cards │ ├── ParkCard.vue │ ├── RideCard.vue │ ├── ReviewCard.vue │ ├── CreditCard.vue │ └── CompanyCard.vue ├── forms/ # Form components │ ├── ParkForm.vue │ ├── ReviewForm.vue │ └── ... └── specialty/ # Complex/unique components ├── SearchAutocomplete.vue ├── Map.vue ├── ImageGallery.vue ├── UnitDisplay.vue └── RatingDisplay.vue ``` ## Base Components (ui/) ### Card ```vue ``` ### Button ```vue ``` ### Badge ```vue ``` ## Entity Cards ### ParkCard Displays park preview with image, name, location, stats, and status. **Required Props:** - `park: Park` - Park object **Displays:** - Park image (with fallback) - Park name - Location (city, country) - Ride count - Average rating - Status badge (Operating/Closed/Under Construction) **Interactions:** - Click navigates to park detail page - Hover shows elevation shadow ```vue ``` ### RideCard Similar structure to ParkCard, but shows: - Ride image - Ride name - Park name (linked) - Key specs (speed, height) - Type badge + Status badge ### ReviewCard Displays user review with: - User avatar + username - Rating (5-star display) - Review date (relative) - Review text - Helpful votes (👍 count) - Actions (Reply, Report) ### CreditCard For user's ride credit list: - Ride thumbnail - Ride name + park name - Ride count with +/- controls - Last ridden date - Edit button ## Specialty Components ### SearchAutocomplete Global search with instant results. **Features:** - Debounced input (300ms) - Results grouped by type (Parks, Rides, Companies) - Keyboard navigation - Click or Enter to navigate - Empty state handling **Implementation Notes:** - Use `useFetch` with `watch` for reactive searching - Show loading skeleton while fetching - Limit results to 10 per category - Highlight matching text ### UnitDisplay Converts and displays values in user's preferred units. ```vue ``` ### RatingDisplay Star rating visualization. ```vue ``` ### Map (Leaflet) Interactive map for parks nearby feature. **Features:** - Marker clusters for dense areas - Custom markers for different park types - Popup on marker click with park preview - Zoom controls - Full-screen toggle - User location marker (if permitted) ## Form Components ### Standard Form Structure ```vue