Persons
Renders a list of person cards using the AuthorCard component. Supports Person content type.
Props
| Prop | Type | Required | Default | Description |
|---|---|---|---|---|
authors | Person[] | Yes | - | Array of person objects from Contentstack |
cslp | CSLPFieldMapping | No | - | CSLP mapping for editable fields |
className | string | No | '' | Additional CSS classes for the container |
label | string | No | 'Author' | Label text to display above person name (e.g., "Author", "Host", "Guest") |
Usage
import Persons from '@/components/organisms/Persons';
<Persons
authors={[
{ title: "John Doe", url: "/person/john-doe", ... },
{ title: "Jane Smith", url: "/person/jane-smith", ... }
]}
className="mb-8"
/>Features
- Renders multiple person cards in a flex wrap layout
- Returns
nullif authors array is empty or undefined - Supports custom className for styling
- Customizable label based on field name (defaults to "Author", can be set to "Host", "Guest", etc.)
- Uses
AuthorCardcomponent internally - Supports
Personcontent type
Custom Labels
The label prop allows you to customize the text displayed above each person's name based on the field name:
// Default: "Author"
<Persons authors={authors} />
// Custom: "Host" (for live stream hosts)
<Persons authors={hosts} label="Host" />
// Custom: "Guest" (for live stream guests)
<Persons authors={guests} label="Guest" />Notes
- Each person card is wrapped with gap-4 spacing
- Uses flex-wrap for responsive layout
- The component name was changed from
AuthorstoPersonsto better reflect support for Person content type