in frontend/src/js/components/viewer/Viewer.tsx [274:304]
renderFullContents(resource: Resource, view: string) {
if (view === 'table') {
return <TablePreview text={resource.text.contents}/>
} else if (view === 'preview') {
return <Preview fingerprint={resource.uri} />;
} else if (view.startsWith('ocr')) {
if (resource.ocr) {
return this.renderTextPreview(resource, _.get(this.props.resource, view), view);
} else {
// Only matters if a user has manually changed the view in the URL params or is visiting a link with them in
return this.renderNoPreview();
}
} else if (view.startsWith('transcript')) {
if (resource.transcript) {
return this.renderTextPreview(resource, _.get(this.props.resource, view), view);
} else {
// Only matters if a user has manually changed the view in the URL params or is visiting a link with them in
return this.renderNoPreview();
}
} else if (resource.extracted) {
return this.renderTextPreview(resource, resource.text, 'text');
} else if (resource.children.length) {
return <LazyTreeBrowser
rootResource={resource}
descendantResources={this.props.descendantResources}
getChildResource={this.props.getChildResource}
/>;
} else {
return this.renderNoPreview();
}
}