Overview
The CardsCam component displays a single camera as a Bootstrap card with a featured image, model name, key specifications, and a link to the detailed camera view. It uses a predefined set of fields to determine which camera properties to display.Component Structure
Props
The camera object containing all camera details. Must include the following properties:
Unique identifier for the camera (used as React key in parent component).
The camera model name, displayed prominently in the card header and used in the route URL.
Array of image URLs. The first image (index 0) is displayed as the card’s featured image.
Camera design type (e.g., “Bala”, “Domo”). Displayed in the specifications list.
Camera resolution (e.g., “1080p”, “4K”). Displayed in the specifications list.
Connectivity type (e.g., “WiFi”, “Ethernet”). Displayed in the specifications list.
Camera brand/manufacturer. Displayed in the specifications list.
Camera type category. Displayed in the specifications list.
Display Fields
The component displays camera specifications based on theFIELDS_CARD constant:
Layout
The component uses Bootstrap responsive grid classes for adaptive card sizing:- Mobile (col-sm-12): One card per row on small screens
- Tablet (col-md-6): Two cards per row on medium screens
- Desktop (col-xl-4): Three cards per row on extra-large screens
Card Structure
The first image from the
imagenes array, displayed at the top of the card with the img-responsivess class.A centered card body section displaying “Modelo: ” in bold.
A flush list group displaying the camera’s key specifications from
FIELDS_CARD.A footer link labeled “Ver” that navigates to
/productos/camaras/{modelo} for the detailed view.Navigation
The card footer includes a React Router Link that navigates to the camera’s detail page:/productos/camaras/{camera_model}
Usage Example
Dependencies
- React Router DOM (Link component)
- Bootstrap CSS (card and grid classes)
- FIELDS_CARD constant (from utilities/const.js)