import { AppColors } from './colors' import { PwaMessages } from './messages' import { escapeHtml } from './source-literals' /** * The page the worker answers with when a page cannot be fetched and has no * cached copy. It lives INSIDE the worker rather than as a precached file, so * it exists even for a site that precaches nothing (a password-protected one) * and can never be stale or evicted. Self-contained: no stylesheet, font or * image it would have to fetch while offline. It reloads itself as soon as the * connection is back. */ export const buildOfflinePageHtml = (params: { appName: string locale: string rightToLeft: boolean messages: PwaMessages colors: AppColors }): string => { const { appName, locale, rightToLeft, messages, colors } = params return ` ${escapeHtml(messages.offlineTitle)} ยท ${escapeHtml(appName)}

${escapeHtml(appName)}

${escapeHtml(messages.offlineTitle)}

${escapeHtml(messages.offlineBody)}

` }