import type { MessageWithState } from "@app/core/stores/deviceStore.js"; import { Hashicon } from "@emeraldpay/hashicon-react"; import type { Protobuf } from "@meshtastic/meshtasticjs"; import { AlertCircleIcon, CheckCircle2Icon, CircleEllipsisIcon, } from "lucide-react"; export interface MessageProps { lastMsgSameUser: boolean; message: MessageWithState; sender?: Protobuf.NodeInfo; } export const Message = ({ lastMsgSameUser, message, sender, }: MessageProps): JSX.Element => { return lastMsgSameUser ? (
{message.state === "ack" ? ( ) : message.state === "waiting" ? ( ) : ( )} {message.data}
) : (
{sender?.user?.longName ?? "UNK"} {message.rxTime.toLocaleTimeString(undefined, { hour: "2-digit", minute: "2-digit", })}
{message.state === "ack" ? ( ) : message.state === "waiting" ? ( ) : ( )} {message.data}
); };