UNPKG

@cognigy/rest-api-client

Version:

Cognigy REST-Client

55 lines 1.97 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const stylesPartial_1 = require("./stylesPartial"); const transcriptAssistTemplate = ({ message, assetsBaseURL, sentiment, fontSize, messageFontSize, }) => { const mapSentimentToColor = { positive: "bg-positive", negative: "bg-negative", neutral: "bg-neutral", }; let currentSentiment = sentiment === null || sentiment === void 0 ? void 0 : sentiment.toLowerCase(); if (currentSentiment) { Object.keys(mapSentimentToColor).forEach((key) => { if (currentSentiment.includes(key)) { currentSentiment = key; } }); } return ` <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Next Best Action</title> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tailwindcss@2.2.19/dist/tailwind.min.css"> <style> ${stylesPartial_1.default} </style> </head> <body> <div class="flex h-screen flex-col justify-center bg-gray-100 rounded-lg"> <div class="relative flex flex-1 overflow-hidden rounded-lg bg-white justify-between shadow-md"> <div class="p-4 w-11/12 overflow-auto"> <div class="${fontSize} font-semibold uppercase tracking-wide text-indigo-500">Transcription</div> <div class="overflow-auto h-5/6"> <p class="mt-2 text-gray-800 ${messageFontSize}">${message}</p> </div> </div> ${currentSentiment ? ` <div id="sentiment" class="flex w-1/12 flex-col items-center justify-center ${mapSentimentToColor[currentSentiment]}"> <div class="mb-2 h-4 w-4"> <img class="max-h-full max-w-full" src="${assetsBaseURL}/assets/${currentSentiment}.svg" alt="Smiley Icon" /> </div> </div> ` : ""} </div> </div> </body> </html> `; }; exports.default = transcriptAssistTemplate; //# sourceMappingURL=transcriptAssistTemplate.js.map