/// <reference types="vinxi/types/client" />
import { hydrateRoot } from 'react-dom/client';
import { StartClient } from '@tanstack/react-start';
import { createRouter } from './router';
import { getLocale, overwriteGetLocale, strategy } from './paraglide/runtime';

const router = createRouter();

if (strategy.includes('cookie')) {
  const inMemoryLocale = getLocale();
  overwriteGetLocale(() => inMemoryLocale);
}

hydrateRoot(document, <StartClient router={router} />);
