Files
Compass/common/src/comment.ts
Martin Braquet ba9b3cfb06 Add pretty formatting (#29)
* Test

* Add pretty formatting

* Fix Tests

* Fix Tests

* Fix Tests

* Fix

* Add pretty formatting fix

* Fix

* Test

* Fix tests

* Clean typeckech

* Add prettier check

* Fix api tsconfig

* Fix api tsconfig

* Fix tsconfig

* Fix

* Fix

* Prettier
2026-02-20 17:32:27 +01:00

40 lines
904 B
TypeScript

import {type JSONContent} from '@tiptap/core'
export const MAX_COMMENT_LENGTH = 10000
type Visibility = 'public' | 'unlisted' | 'private'
// Currently, comments are created after the bet, not atomically with the bet.
// They're uniquely identified by the pair contractId/betId.
export type Comment = {
id: string
replyToCommentId?: string
userId: string
// profile
commentType: 'profile'
onUserId: string
/** @deprecated - content now stored as JSON in content*/
text?: string
content: JSONContent
createdTime: number
// Denormalized, for rendering comments
userName: string
userUsername: string
userAvatarUrl?: string
hidden?: boolean
hiddenTime?: number
hiderId?: string
pinned?: boolean
pinnedTime?: number
pinnerId?: string
visibility: Visibility
editedTime?: number
isApi?: boolean
}
export type ReplyToUserInfo = {id: string; username: string}