2024-07-11 18:54:56 +02:00
|
|
|
import * as React from "bloatless-react";
|
|
|
|
|
|
|
|
|
|
import { Chat, MessageObject } from "../../Model/chatModel";
|
|
|
|
|
|
2024-07-11 22:35:46 +02:00
|
|
|
import { ObjectGridView } from "./objectGridView";
|
2024-07-12 20:40:03 +02:00
|
|
|
import { translation } from "../../translations";
|
2024-07-11 18:54:56 +02:00
|
|
|
|
|
|
|
|
export function AllObjectsView(
|
|
|
|
|
chat: Chat,
|
2024-07-13 17:13:59 +02:00
|
|
|
messageObjects: React.MapState<MessageObject>,
|
2024-07-11 18:54:56 +02:00
|
|
|
selectedObject: React.State<MessageObject | undefined>,
|
|
|
|
|
isShowingObjectModal: React.State<boolean>
|
|
|
|
|
) {
|
2024-07-12 20:40:03 +02:00
|
|
|
const objectCount = React.createProxyState(
|
|
|
|
|
[chat.objects],
|
|
|
|
|
() => chat.objects.value.size
|
|
|
|
|
);
|
|
|
|
|
|
2024-07-12 19:04:57 +02:00
|
|
|
return (
|
2024-07-12 20:40:03 +02:00
|
|
|
<div class="width-100 height-100 scroll-v padding-top">
|
|
|
|
|
<b class="secondary padding">
|
|
|
|
|
{translation.objectsInTotal}{" "}
|
|
|
|
|
<span subscribe:innerText={objectCount}></span>
|
|
|
|
|
</b>
|
2024-07-13 17:13:59 +02:00
|
|
|
{ObjectGridView(
|
|
|
|
|
chat,
|
|
|
|
|
messageObjects,
|
|
|
|
|
selectedObject,
|
|
|
|
|
isShowingObjectModal
|
|
|
|
|
)}
|
2024-07-12 19:04:57 +02:00
|
|
|
</div>
|
2024-07-11 18:54:56 +02:00
|
|
|
);
|
|
|
|
|
}
|