import React from "react"; import ReactDOMServer from "react-dom/server"; import { getNationalNumber, formatSeconds } from "./util"; import { DateTime } from "luxon"; import type { Contact } from "./types"; import type { StoredVoicemail } from "knex/types/tables"; export function getTicketSubject( voicemail: StoredVoicemail, contact?: Contact ) { return `New Voicemail from ${getNationalNumber(voicemail.fromNumber)} (${ contact ? contact.name : voicemail.fromName })`; } export function getTicketBody(vm: StoredVoicemail, contact?: Contact) { return ReactDOMServer.renderToStaticMarkup(
{vm.transcription ? `"${vm.transcription}"` : vm.transcriptionStatus}