add logic for sending and receiving items
This commit is contained in:
@@ -4,9 +4,18 @@ import { Chat } from "../Model/chatModel";
|
||||
import { translation } from "../translations";
|
||||
|
||||
export function ChatToolView(chat: Chat) {
|
||||
function createItem() {
|
||||
chat.createItem({
|
||||
id: React.UUID(),
|
||||
title: "new item",
|
||||
});
|
||||
}
|
||||
|
||||
return (
|
||||
<div class="chat-tool-view">
|
||||
<span>Tools</span>
|
||||
<button on:click={createItem}>+</button>
|
||||
<hr></hr>
|
||||
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -12,11 +12,11 @@ export function MessageComposer(chat: Chat) {
|
||||
style="max-width: unset"
|
||||
placeholder={translation.composerPlaceholder}
|
||||
bind:value={chat.composingMessage}
|
||||
on:enter={chat.sendNewMessage}
|
||||
on:enter={chat.sendMessageFromComposer}
|
||||
></input>
|
||||
<button
|
||||
class="primary"
|
||||
on:click={chat.sendNewMessage}
|
||||
on:click={chat.sendMessageFromComposer}
|
||||
toggle:disabled={chat.cannotSendMessage}
|
||||
>
|
||||
<span class="icon">send</span>
|
||||
|
||||
Reference in New Issue
Block a user