import { configureTracking } from "@agent-native/core/client/analytics"; import { appPath } from "@agent-native/core/client/api-path"; import { AppProviders, createAgentNativeQueryClient, useDbSync, } from "@agent-native/core/client/hooks"; import { getLocaleInitScript } from "@agent-native/core/client/i18n"; import { getThemeInitScript } from "@agent-native/core/client/ui"; import { useQueryClient } from "@tanstack/react-query"; import { useState } from "react"; import { Links, Meta, Outlet, Scripts, ScrollRestoration } from "react-router"; import type { LinksFunction } from "react-router"; import { CrmCommandMenu } from "@/components/layout/CrmCommandMenu"; import { CrmLayout } from "@/components/layout/CrmLayout"; import { AppToolkitProvider } from "@/components/ui/toolkit-provider"; import { useNavigationState } from "@/hooks/use-navigation-state"; import { i18nCatalog } from "@/i18n"; import { TAB_ID } from "@/lib/tab-id"; import stylesheet from "./global.css?url"; configureTracking({ getDefaultProps: (_name, properties) => ({ ...properties, app: "crm", template: "crm", }), }); export const links: LinksFunction = () => [ { rel: "stylesheet", href: stylesheet }, ]; export function Layout({ children }: { children: React.ReactNode }) { return (