import Area from '@components/common/Area.js'; import { Alert } from '@components/common/modal/Alert.js'; import React from 'react'; import { Route } from '../../../../types/route.js'; import { COMMERCE_EVENT_STUB } from './commerceEventStub.js'; import { FETCH_LOCALE_PATCH } from './fetchLocalePatch.js'; interface ServerHtmlProps { route: Route; css: string[]; js: string[]; appContext: string; } function ServerHtml({ route, css, js, appContext }: ServerHtmlProps) { const classes = route.isAdmin ? `admin ${route.id}` : `frontStore ${route.id}`; return ( <>
{/* Storefront only: carry the page locale on same-origin REST XHRs (cart/ checkout/customer) via an X-Locale header (spec ยง6.13). Admin is single- language, so it's not patched. */} {!route.isAdmin && ( )} {/* Storefront only: window.evershop.onCommerceEvent for head scripts, before the bundle brings the commerce event bus */} {!route.isAdmin && ( )} {css.map((source, index) => ( ))}