2024-07-07 22:11:18 +02:00
|
|
|
import * as React from "bloatless-react";
|
|
|
|
|
|
2024-07-09 14:11:20 +02:00
|
|
|
import { Chat } from "../Model/chatModel";
|
2024-07-07 22:11:18 +02:00
|
|
|
import { translation } from "../translations";
|
|
|
|
|
|
2024-07-09 14:28:13 +02:00
|
|
|
export function MessageComposer(chat: Chat) {
|
|
|
|
|
return (
|
|
|
|
|
<div class="flex-row width-100">
|
|
|
|
|
{" "}
|
|
|
|
|
<input
|
|
|
|
|
class="width-100 flex-1"
|
|
|
|
|
style="max-width: unset"
|
|
|
|
|
placeholder={translation.composerPlaceholder}
|
|
|
|
|
bind:value={chat.composingMessage}
|
2024-07-10 15:08:06 +02:00
|
|
|
on:enter={chat.sendNewMessage}
|
2024-07-09 14:28:13 +02:00
|
|
|
></input>
|
|
|
|
|
<button
|
|
|
|
|
class="primary"
|
2024-07-10 15:08:06 +02:00
|
|
|
on:click={chat.sendNewMessage}
|
2024-07-09 14:28:13 +02:00
|
|
|
toggle:disabled={chat.cannotSendMessage}
|
|
|
|
|
>
|
|
|
|
|
<span class="icon">send</span>
|
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2024-07-07 22:11:18 +02:00
|
|
|
}
|