ContentWrapper
The ContentWrapper component fetches and provides user-generated content data using a render function pattern. It accepts either a publicId or externalId to identify the content, and passes the resolved content along with loading state to a child render function.
If content is not set (and loading is false), the ID was either not found or the content has been moderated and will not be shown. Users will always be able to see their own content.
Use ContentWrapper when you need full control over how content is rendered. For a simpler image-specific wrapper, see ImageContentWrapper.
Content rendered through ContentWrapper is wrapped in a ContentMonitor that allows users to report it for moderation.
Content rendered through ContentWrapper is wrapped in a ContentMonitor that allows users to report it for moderation.
Anchor to propsProps
- Anchor to childrenchildrenchildren({ content, loading, }: { content?: Content; loading: boolean; }) => Element({ content, loading, }: { content?: Content; loading: boolean; }) => Elementrequiredrequired
A render function that receives the content data and loading state, and returns a React element.
- Anchor to externalIdexternalIdexternalIdstringstring
The external ID of the content item (use this OR publicId).
- Anchor to publicIdpublicIdpublicIdstringstring
The public ID of the content item (use this OR externalId).
Content
- description
string | null - externalId
string | null - image
ContentImage - products
ContentProduct[] | null - publicId
string - shareableUrl
string | null - status
MinisContentStatus | null - title
string - visibility
ContentVisibility[]
ContentImage
- altText
string | null - height
number | null - id
string | null - thumbhash
string | null - url
string - width
number | null
ContentProduct
- featuredImage
ContentImage | null - id
string - title
string
MinisContentStatus
- PENDING
PENDING - READY
READY - REJECTED
REJECTED
ContentVisibility
'DISCOVERABLE' | 'LINKABLE'