box-ui-elements icon indicating copy to clipboard operation
box-ui-elements copied to clipboard

Add the ability to customize the preview error

Open scottapow opened this issue 2 years ago • 0 comments

For our implementation we would like to add a support message under the error message (rendered by <PreviewError />) so that the user has some recourse.

This could be done through a render prop on the ContentPreview component, providing the defaultRender or errorCode as arguments; much like the renderCustomActionButtons on `<ContentPicker />.

Example:

    <ContentPreview
        fileId={FILE_ID}
        token={TOKEN}
        renderCustomErrorMessage={(defaultRender) => (
            <>
                {defaultRender()}
                <p>Please contact support at +1 (234) 567-8910</p>
            </>
        )}
    />

scottapow avatar Jan 11 '23 04:01 scottapow