add total object count

This commit is contained in:
marlon-erler
2024-07-12 20:40:03 +02:00
parent 7c4100d67d
commit 2a30dfc1a3
5 changed files with 29 additions and 6 deletions
+11 -1
View File
@@ -3,14 +3,24 @@ import * as React from "bloatless-react";
import { Chat, MessageObject } from "../../Model/chatModel";
import { ObjectGridView } from "./objectGridView";
import { translation } from "../../translations";
export function AllObjectsView(
chat: Chat,
selectedObject: React.State<MessageObject | undefined>,
isShowingObjectModal: React.State<boolean>
) {
const objectCount = React.createProxyState(
[chat.objects],
() => chat.objects.value.size
);
return (
<div class="width-100 height-100">
<div class="width-100 height-100 scroll-v padding-top">
<b class="secondary padding">
{translation.objectsInTotal}{" "}
<span subscribe:innerText={objectCount}></span>
</b>
{ObjectGridView(chat, chat.objects, selectedObject, isShowingObjectModal)}
</div>
);
+1 -1
View File
@@ -21,7 +21,7 @@ export function NoteObjectsView(
);
});
return <div class="width-100 height-100">
return <div class="width-100 height-100 scroll-v">
{ObjectGridView(chat, notes, selectedObject, isShowingObjectModal)}
</div>;
}
+1 -1
View File
@@ -26,7 +26,7 @@ export function ObjectGridView(
return (
<div
class="width-100 max-height-100 grid gap padding scroll-v"
class="grid gap padding"
style="grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));"
children:prepend={[messageObjects, objectConverter]}
></div>