2024-03-06 08:10:42 +01:00
|
|
|
import { JSXElement, } from "solid-js";
|
|
|
|
import { PublicComment } from "../Util/api";
|
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
|
|
|
|
*/
|
|
|
|
export function Comment({ comment }: { comment: PublicComment }): JSXElement {
|
2024-03-06 00:48:19 +01:00
|
|
|
return (
|
2024-03-06 08:10:42 +01:00
|
|
|
<div class="flex flex-col space-y-2">
|
|
|
|
<div class="flex flex-row space-x-2">
|
|
|
|
<div class="text-xs text-gray-500">{comment.created_at}</div>
|
2024-03-06 00:48:19 +01:00
|
|
|
</div>
|
2024-03-06 08:10:42 +01:00
|
|
|
<div class="text-sm">{comment.content}</div>
|
2024-03-06 00:48:19 +01:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|