FrostByte/client-solid/src/Components/Comment.tsx

25 lines
840 B
TypeScript
Raw Normal View History

import { JSXElement } from "solid-js";
import { PublicComment } from "../Util/api";
interface CommentProps {
comment: PublicComment;
}
2024-03-06 00:48:19 +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 }: CommentProps): JSXElement {
2024-03-06 00:48:19 +01:00
return (
2024-03-12 19:39:48 +01:00
<div class="flex px-2 min-w-full flex-col rounded-lg border-b-2 border-b-secondary bg-base-300 py-2 text-base-content transition-all hover:bg-base-300 md:px-12">
<div class="flex flex-row">
2024-03-12 19:39:48 +01:00
<div class="pb-1 text-xs text-gray-500">{comment.created_at}</div>
2024-03-06 00:48:19 +01:00
</div>
<div class="text-sm">{comment.content}</div>
2024-03-06 00:48:19 +01:00
</div>
);
}