Styling hacker greentext formatting

This commit is contained in:
Zhongheng Liu 2024-01-03 16:22:09 +02:00
commit f90cf89b39
No known key found for this signature in database
7 changed files with 58 additions and 58 deletions

View file

@ -0,0 +1,15 @@
import React from "react";
import { Message, MessageType } from "./types";
export const MessageContainer = (
{
type,
fromUserId,
toUserId,
content,
timeMillis,
}: Message
): React.ReactElement<{ sender: string; text: string; }> => {
const dateTime: Date = new Date(timeMillis);
return (<p>[{dateTime.toLocaleString(Intl.DateTimeFormat().resolvedOptions().timeZone)}] Message from {fromUserId}: {content}</p>);
};