Files
Compass/common/src/supabase/comment.ts
2025-08-27 21:30:05 +02:00

18 lines
543 B
TypeScript

import { type JSONContent } from '@tiptap/core'
import { type Row, tsToMillis } from './utils'
import { type Comment } from 'common/comment'
export const convertComment = (row: Row<'lover_comments'>): Comment => ({
id: row.id + '',
userId: row.user_id,
commentType: 'lover',
onUserId: row.on_user_id,
createdTime: tsToMillis(row.created_time),
userName: row.user_name,
userUsername: row.user_username,
userAvatarUrl: row.user_avatar_url,
hidden: row.hidden,
visibility: 'public',
content: row.content as JSONContent,
})