box/box-ui-elements

Add the ability to customize the preview error

scottapow opened this issue · 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 `.

Example:

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