;
}
+ let body =
+
+
+ ;
+ if (_.isArray(browseFiles)) {
+ body = <>>} // Hide the preview that the 3rd party provided.
+ />;
+ }
+
return <>
{clearButton}
{buttons}
- <>>} // Hide the preview that the 3rd party provided.
- />
+ {body}
>
}
@@ -291,12 +300,12 @@ function FileCard({file}) {
}
export function FileCards({files}) {
- if (!isEmpty(files)) {
+ if (!_.isEmpty(files)) {
return
{files.map(i => )}
} else if (files && files.length === 0) {
- return No files found.
+ return No results!
} else {
return
}
@@ -379,7 +388,13 @@ function FileRow({file}) {
}
export function FileTable({files, selectOn, onSelect, footer, selectedKeys}) {
- if (!isEmpty(files)) {
+ if (!files) {
+ return
+
+
+
+
+ } else if (files && files.length > 0) {
const headerContents = ['Poster', 'Title'];
const rows = files.map(i => );
return ;
- } else if (isEmpty(files)) {
- return
No results!
} else {
- return
-
-
-
-
+ return
No results!
}
}
@@ -472,8 +481,7 @@ export function FilesView({
if (view === 'list') {
const footer = selectOn && selectElem ?
<>
-
- {selectElem}
+ {selectElem}
> : null;
body = ;
diff --git a/app/src/components/Inventory.js b/app/src/components/Inventory.js
index 859a8435..1c962e95 100644
--- a/app/src/components/Inventory.js
+++ b/app/src/components/Inventory.js
@@ -26,7 +26,7 @@ import {
} from "semantic-ui-react";
import {Route, Routes} from "react-router-dom";
import {toast} from 'react-semantic-toasts';
-import {arraysEqual, enumerate, isEmpty, PageContainer, replaceNullValues, TabLinks, useTitle} from './Common';
+import {arraysEqual, enumerate, PageContainer, replaceNullValues, TabLinks, useTitle} from './Common';
import _ from 'lodash';
import {ThemeContext} from "../contexts/contexts";
import {useInventory} from "../hooks/customHooks";
@@ -50,7 +50,7 @@ function InventorySummary() {
}
- if (!isEmpty(byCategory)) {
+ if (!_.isEmpty(byCategory)) {
return
@@ -77,7 +77,7 @@ function InventorySummary() {
}
- if (!isEmpty(bySubcategory)) {
+ if (!_.isEmpty(bySubcategory)) {
return
@@ -106,7 +106,7 @@ function InventorySummary() {
}
- if (!isEmpty(byName)) {
+ if (!_.isEmpty(byName)) {
return
@@ -309,7 +309,7 @@ class InventoryList extends React.Component {
}
render() {
- if (isEmpty(this.props.items)) {
+ if (_.isEmpty(this.props.items)) {
return
{({t}) => (
Add some items using the form above!
@@ -386,7 +386,7 @@ class InventoryList extends React.Component {