|
|
|
@ -64,8 +64,9 @@ function InventoryList({items, docType, openDoc, defaultTab=null, level=undefine
|
|
|
|
</div>}
|
|
|
|
</div>}
|
|
|
|
<div className="inventory-list">
|
|
|
|
<div className="inventory-list">
|
|
|
|
{ [...items].sort(
|
|
|
|
{ [...items].sort(
|
|
|
|
// Sort entries `available > disabled > locked`.
|
|
|
|
// For lemas, sort entries `available > disabled > locked`
|
|
|
|
(x, y) => +x.locked - +y.locked || +x.disabled - +y.disabled
|
|
|
|
// otherwise alphabetically
|
|
|
|
|
|
|
|
(x, y) => +(docType == "Lemma") * (+x.locked - +y.locked || +x.disabled - +y.disabled)
|
|
|
|
).map(item => {
|
|
|
|
).map(item => {
|
|
|
|
if ((tab ?? categories[0]) == item.category) {
|
|
|
|
if ((tab ?? categories[0]) == item.category) {
|
|
|
|
return <InventoryItem key={item.name} showDoc={() => {openDoc(item.name, docType)}}
|
|
|
|
return <InventoryItem key={item.name} showDoc={() => {openDoc(item.name, docType)}}
|
|
|
|
|