create separate component for home page buttons

This commit is contained in:
marlon-erler
2026-04-08 20:31:25 +00:00
parent 12c77979bf
commit ca674e16fa
12 changed files with 94 additions and 75 deletions
-1
View File
@@ -57,7 +57,6 @@ export function ChatMessage(chatMessageViewModel: ChatMessageViewModel) {
<span class="icon">info</span>
</button>
</div>
</div>
{MessageReactionButtonRow(chatMessageViewModel)}
{ChatMessageInfoModal(chatMessageViewModel)}
+12
View File
@@ -0,0 +1,12 @@
import * as React from "bloatless-react";
export function HomePageButton(action: () => void, label: string) {
return (
<button class="tile flex-no" on:click={action}>
<span class="icon">sync_alt</span>
<div>
<span>{label}</span>
</div>
</button>
);
}
@@ -1,5 +1,8 @@
import * as React from "bloatless-react";
import { ChatMessageReaction, ReactionSymbols } from "../../Model/Chat/chatModel";
import {
ChatMessageReaction,
ReactionSymbols,
} from "../../Model/Chat/chatModel";
import ChatMessageViewModel from "../../ViewModel/Chat/chatMessageViewModel";
import { translations } from "../translations";
@@ -68,7 +71,7 @@ export function MessageReactionButton(
reactionState.subscribe(() => {
isActive.value = checkIsHighlighted();
isZero.value = reactionState.value.size == 0;
})
});
return (
<button
@@ -13,14 +13,8 @@ export function MessageReactionButtonRow(
chatMessageViewModel,
ReactionSymbols.ThumbsUp,
)}
{MessageReactionButton(
chatMessageViewModel,
ReactionSymbols.Check,
)}
{MessageReactionButton(
chatMessageViewModel,
ReactionSymbols.Stop,
)}
{MessageReactionButton(chatMessageViewModel, ReactionSymbols.Check)}
{MessageReactionButton(chatMessageViewModel, ReactionSymbols.Stop)}
{MessageReactionButton(
chatMessageViewModel,
ReactionSymbols.Attention,