format code

This commit is contained in:
2025-07-09 18:11:33 +08:00
parent d84b8314e4
commit 0eb24eee2f
4 changed files with 56 additions and 42 deletions

View File

@@ -46,7 +46,7 @@ export default function CommentPage() {
const onUpdated = useCallback(() => {
setComment(null);
const id = parseInt(commentId || "0");
const id = parseInt(commentId || "0");
if (isNaN(id) || id <= 0) {
showToast({
message: t("Invalid comment ID"),
@@ -116,11 +116,11 @@ export default function CommentPage() {
<CommentContent content={comment.content} />
</article>
{app.user?.id === comment.user.id && (
<div className="flex flex-row justify-end mt-2">
<EditCommentDialog comment={comment} onUpdated={onUpdated} />
<DeleteCommentDialog commentId={comment.id} onUpdated={onDeleted} />
</div>
)}
<div className="flex flex-row justify-end mt-2">
<EditCommentDialog comment={comment} onUpdated={onUpdated} />
<DeleteCommentDialog commentId={comment.id} onUpdated={onDeleted} />
</div>
)}
<div className="h-4" />
<div className="border-t border-base-300" />
<div className="h-4" />
@@ -282,7 +282,6 @@ function CommentsList({
);
}
function EditCommentDialog({
comment,
onUpdated,
@@ -460,4 +459,4 @@ function DeleteCommentDialog({
</dialog>
</>
);
}
}