import { MfmHelpers } from "../helpers/mfm.js";
import mfm from "mfm-js";
export class AnnouncementConverter {
    static async encode(announcement, isRead) {
        return {
            id: announcement.id,
            content: `<h1>${await MfmHelpers.toHtml(mfm.parse(announcement.title), [], null) ?? 'Announcement'}</h1>${await MfmHelpers.toHtml(mfm.parse(announcement.text), [], null) ?? ''}`,
            starts_at: null,
            ends_at: null,
            published: true,
            all_day: false,
            published_at: announcement.createdAt.toISOString(),
            updated_at: announcement.updatedAt?.toISOString() ?? announcement.createdAt.toISOString(),
            read: isRead,
            mentions: [],
            statuses: [],
            tags: [],
            emojis: [],
            reactions: []
        };
    }
}
