2024-03-08 14:52:20 +01:00
|
|
|
import { JSXElement } from "solid-js";
|
|
|
|
|
|
|
|
import { PublicComment } from "../Util/api";
|
2024-03-11 22:07:39 +01:00
|
|
|
|
|
|
|
interface CommentProps {
|
|
|
|
comment: PublicComment;
|
|
|
|
}
|
2024-03-06 00:48:19 +01:00
|
|
|
|
2024-03-06 08:10:42 +01:00
|
|
|
/**
|
|
|
|
* Comment is a component that displays a single comment.
|
|
|
|
* @param {Object} props The properties for the Comment component.
|
|
|
|
* @param {string} props.postId The id of the post that the comment is a reply to.
|
|
|
|
* @returns {JSXElement} A JSXElement of a comment
|
|
|
|
*/
|
2024-03-11 22:07:39 +01:00
|
|
|
export function Comment({ comment }: CommentProps): JSXElement {
|
2024-03-06 00:48:19 +01:00
|
|
|
return (
|
2024-03-18 15:59:32 +01:00
|
|
|
<>
|
|
|
|
<div class="chat chat-start">
|
|
|
|
<time class="text-xs opacity-50">{comment.created_at}</time>
|
2024-03-06 00:48:19 +01:00
|
|
|
</div>
|
2024-03-18 15:59:32 +01:00
|
|
|
<div class="chat-bubble">{comment.content}</div>
|
|
|
|
<div class="chat chat-end">
|
|
|
|
<time class="text-xs opacity-50">Reply created_at</time>
|
|
|
|
<div class="chat-bubble">Replies to parent comment if any</div>
|
|
|
|
</div>
|
|
|
|
</>
|
2024-03-06 00:48:19 +01:00
|
|
|
);
|
|
|
|
}
|