Files
5chan/src/lib/utils/comment-moderation-utils.ts
T
Tommaso CasaburiandGitHub aedee9fb83 feat(archive): implement comment.archived and add archive page (#1074)
* feat(archive): implement comment.archived and add archive page

Add isCommentArchived() utility, /board/:boardIdentifier/archive route,
archive view with filtered feed, and UI integration (board buttons, edit
menu, catalog row, post). Archived indicator on catalog and posts.

* fix(archive): address review feedback from Bugbot and CodeRabbit

Add missing i18n keys (archived, thread_archived, view, loading_archive),
add /archive/settings route, replace hardcoded English in archive.tsx, and
fix mobile test state.
2026-03-13 16:06:36 +08:00

16 lines
400 B
TypeScript

type MaybeArchivedComment = {
archived?: boolean;
commentModeration?: {
archived?: boolean;
};
};
export const isCommentArchived = (comment: unknown): boolean => {
if (!comment || typeof comment !== 'object') {
return false;
}
const archivedComment = comment as MaybeArchivedComment;
return Boolean(archivedComment.archived || archivedComment.commentModeration?.archived);
};