import { PrintCss } from './PrintStyles'; import { PRINT_LOGO } from '../../constants'; import { GetPrintLogo, type PrintLogoData } from '../utils/imageUtils'; import { getConfig } from '@openmrs/esm-framework'; export const GetPrintTemplate = ( body: string, title: string | null | undefined, printOnLoad = false, closeAfterPrint = true, ) => { return ` ${title ?? ''} ${body} `; }; export const GetLogoSection = async () => { const config = await getConfig('@openmrs/esm-stock-management-app'); const logoText = config?.logo?.name; let printLogoData: PrintLogoData | null = null; if (PRINT_LOGO) { try { printLogoData = await GetPrintLogo(); } catch (e) { console.info(e); } } return printLogoData || logoText ? ` ` : ''; }; export const GetHeaderSection = async () => { const logoSection = await GetLogoSection(); return `
${logoSection}
`; };