Overview
LoadingSpinner is a simple, stateless component that displays an animated loading indicator with accompanying text. It’s used throughout the application to provide visual feedback during asynchronous operations.
Import
Props
This component accepts no props. It’s a completely static component.Component Signature
Features
Animated Circle
The component renders a div with the class.loading-spinner__circle which is typically styled with CSS animations to create a spinning effect.
Loading Text
Displays “Cargando…” (Spanish for “Loading…”) below the spinner.Usage Example
- In PeliculaGrid
- In Detail Page
- Standalone
Rendered Structure
CSS Classes
.loading-spinner- Main container.loading-spinner__circle- Animated spinner element (typically styled with CSS animations).loading-spinner__text- “Cargando…” text element
Typical CSS Animation
While CSS is not provided in the component, the spinner is typically animated like this:Usage Patterns
Commonly used in these scenarios:- Grid Loading - While fetching/filtering movie lists
- Detail Loading - While loading individual movie details
- Search Results - During debounced search operations
- Async Operations - Any time data is being fetched
Conditional Rendering Pattern
Accessibility
- Consider adding
role="status"to the container - Consider adding
aria-live="polite"for screen readers - The text “Cargando…” provides context for screen readers
Enhancement Suggestions
Source Location
src/components/LoadingSpinner.jsx:3