Initial Commit

This commit is contained in:
2026-10-03 20:07:49 +02:00
commit a1346c98b1
427 changed files with 59320 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
import type { CommentAttachment } from '~~/shared/utils/attachments'
export interface LiveComment {
id: number
content: string
createdAt: string
userName: string
userId: number
userColor: string | null
userAvatarUrl: string | null
uploadId: string
attachments?: CommentAttachment[]
}
export function useLiveComments() {
const liveComments = useState<LiveComment[]>('comments:live', () => [])
function pushLive(comment: LiveComment) {
if (liveComments.value.some(c => c.id === comment.id)) return
liveComments.value = [comment, ...liveComments.value].slice(0, 50)
}
return { liveComments, pushLive }
}