mirror of
https://github.com/hanzoai/sign.git
synced 2026-10-30 14:57:59 +00:00
The product is branded Hanzo eSign (esign.hanzo.ai, repo hanzoai/esign). Rename all workspace packages @hanzo/sign-* → @hanzo/esign-* (1052 files) and align docker/Dockerfile turbo --scope/--filter to the actual remix package name @hanzo/esign (was a pre-existing mismatch with -remix that broke the build). Protected deps (@hanzo/insights, @hanzo/logo) untouched.
51 lines
1.2 KiB
TypeScript
51 lines
1.2 KiB
TypeScript
import { StrictMode, startTransition, useEffect } from 'react';
|
|
|
|
import { i18n } from '@lingui/core';
|
|
import { detect, fromHtmlTag } from '@lingui/detect-locale';
|
|
import { I18nProvider } from '@lingui/react';
|
|
import insights from '@hanzo/insights';
|
|
import { hydrateRoot } from 'react-dom/client';
|
|
import { HydratedRouter } from 'react-router/dom';
|
|
|
|
import { extractInsightsConfig } from '@hanzo/esign-lib/constants/feature-flags';
|
|
import { dynamicActivate } from '@hanzo/esign-lib/utils/i18n';
|
|
|
|
import './utils/polyfills/promise-with-resolvers';
|
|
|
|
function InsightsInit() {
|
|
const insightsConfig = extractInsightsConfig();
|
|
|
|
useEffect(() => {
|
|
if (insightsConfig) {
|
|
insights.init(insightsConfig.key, {
|
|
api_host: insightsConfig.host,
|
|
capture_exceptions: true,
|
|
});
|
|
}
|
|
}, []);
|
|
|
|
return null;
|
|
}
|
|
|
|
async function main() {
|
|
const locale = detect(fromHtmlTag('lang')) || 'en';
|
|
|
|
await dynamicActivate(locale);
|
|
|
|
startTransition(() => {
|
|
hydrateRoot(
|
|
document,
|
|
<StrictMode>
|
|
<I18nProvider i18n={i18n}>
|
|
<HydratedRouter />
|
|
</I18nProvider>
|
|
|
|
<InsightsInit />
|
|
</StrictMode>,
|
|
);
|
|
});
|
|
}
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-floating-promises
|
|
main();
|