Files
CT/src/View/Modals/chatMessageInfoModal.tsx
T

110 lines
4.4 KiB
TypeScript
Raw Normal View History

2024-07-21 13:13:41 +02:00
import * as React from "bloatless-react";
2024-07-22 21:07:44 +02:00
import ChatMessageViewModel from "../../ViewModel/Chat/chatMessageViewModel";
import { MessageReactionButtonRow } from "../Components/messageReactionButtonRow";
import { InfoTile } from "../Components/infoTile";
import CoreViewModel from "../../ViewModel/Global/coreViewModel";
import { MessageReactionEntry } from "../Components/messageReactionEntry";
2024-07-21 13:13:41 +02:00
export function ChatMessageInfoModal(
coreViewModel: CoreViewModel,
2026-04-01 08:29:39 +00:00
chatMessageViewModel: ChatMessageViewModel,
2024-07-21 13:13:41 +02:00
) {
2026-04-01 08:29:39 +00:00
return (
<div
class="modal"
toggle:open={chatMessageViewModel.isPresentingInfoModal}
>
<div>
<main>
<h2>
{
coreViewModel.translations.chatPage.message
.messageInfoHeadline
}
</h2>
2024-07-21 13:13:41 +02:00
2026-04-01 08:29:39 +00:00
<div class="flex-column gap">
2026-04-09 15:45:19 +00:00
{InfoTile(
"account_circle",
coreViewModel.translations.chatPage.message.sentBy,
2026-04-09 15:45:19 +00:00
chatMessageViewModel.sender,
)}
{InfoTile(
"schedule",
coreViewModel.translations.chatPage.message
.timeSent,
2026-04-09 15:45:19 +00:00
chatMessageViewModel.dateSent,
)}
{InfoTile(
"forum",
coreViewModel.translations.chatPage.message.channel,
2026-04-09 15:45:19 +00:00
chatMessageViewModel.channel,
)}
{InfoTile(
"description",
coreViewModel.translations.chatPage.message
.messageContent,
2026-04-09 15:45:19 +00:00
chatMessageViewModel.body,
)}
2026-04-01 08:29:39 +00:00
</div>
2024-07-21 13:13:41 +02:00
2026-04-01 08:29:39 +00:00
<hr></hr>
2024-07-21 13:13:41 +02:00
2026-04-01 08:29:39 +00:00
<div class="flex-column gap">
<button on:click={chatMessageViewModel.copyMessage}>
{
coreViewModel.translations.chatPage.message
.copyMessageButton
}
2026-04-01 08:29:39 +00:00
<span class="icon">content_copy</span>
</button>
<button on:click={chatMessageViewModel.resendMessage}>
{
coreViewModel.translations.chatPage.message
.resendMessageButton
}
2026-04-01 08:29:39 +00:00
<span class="icon">redo</span>
</button>
<button on:click={chatMessageViewModel.decryptMessage}>
{
coreViewModel.translations.chatPage.message
.decryptMessageButton
}
2026-04-01 08:29:39 +00:00
<span class="icon">key</span>
</button>
<button on:click={chatMessageViewModel.reply}>
{
coreViewModel.translations.chatPage.message
.replyToMessageButton
}
<span class="icon">reply</span>
</button>
2026-04-01 08:29:39 +00:00
</div>
2026-04-07 18:39:55 +00:00
<hr></hr>
<div class="flex-column gap">
{MessageReactionButtonRow(
coreViewModel,
chatMessageViewModel,
)}
<div
class="flex-column gap"
children:append={[
chatMessageViewModel.allReactions,
MessageReactionEntry,
]}
></div>
</div>
2026-04-01 08:29:39 +00:00
</main>
<button on:click={chatMessageViewModel.hideInfoModal}>
{coreViewModel.translations.general.closeButton}
2026-04-01 08:29:39 +00:00
<span class="icon">close</span>
</button>
</div>
</div>
);
2024-07-21 13:13:41 +02:00
}